Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.jasperreports.engine.export.ooxml
Class JRDocxExporter

    java.lang.Object
      net.sf.jasperreports.engine.JRAbstractExporter
          net.sf.jasperreports.engine.export.ooxml.JRDocxExporter

All Implemented Interfaces:
  JRExporter

    public class JRDocxExporter

extends JRAbstractExporter

Exports a JasperReports document to DOCX format. It has character output type and exports the document to a grid-based layout.

Version:
  $Id: JRDocxExporter.java 4014 2010-10-27 10:24:05Z teodord $
Author:
  sanda zaharia (shertage@users.sourceforge.net)

Nested Class Summary
`protected class` | `JRDocxExporter.ExporterContext`

Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
`JRAbstractExporter.BaseExporterContext, JRAbstractExporter.ParameterOverriddenResolver, JRAbstractExporter.ParameterOverrideResolver, JRAbstractExporter.ParameterResolver`

Field Summary
`protected java.awt.Color` | `backcolor`
`protected java.util.LinkedList` | `backcolorStack`
`protected boolean` | `deepGrid`
`protected DocxDocumentHelper` | `docHelper`
`protected java.io.Writer` | `docWriter`
`static java.lang.String` | `DOCX_EXPORTER_KEY` The exporter key, as used in `GenericElementHandlerEnviroment.getHandler(net.sf.jasperreports.engine.JRGenericElementType, String)`.
`protected static java.lang.String` | `DOCX_EXPORTER_PROPERTIES_PREFIX`
`protected boolean` | `flexibleRowHeight`
`protected java.util.Map` | `fontMap` Deprecated.
`static java.lang.String` | `IMAGE_NAME_PREFIX`
`protected static int` | `IMAGE_NAME_PREFIX_LEGTH`
`protected java.util.Map` | `imageMaps`
`protected java.util.List` | `imagesToProcess`
`protected static java.lang.String` | `JR_PAGE_ANCHOR_PREFIX`
`protected ExporterNature` | `nature`
`protected int` | `pageIndex`
`protected JRExportProgressMonitor` | `progressMonitor`
`static java.lang.String` | `PROPERTY_HIDDEN_TEXT` This property is used to mark text elements as being hidden either for printing or on-screen display.
`protected java.util.Map` | `rendererToImagePathMap`
`protected int` | `reportIndex`
`protected boolean` | `startPage`
`protected int` | `tableIndex`

Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
`classLoader, classLoaderSet, dateFormatCache, endPageIndex, fileResolver, fileResolverSet, filter, globalOffsetX, globalOffsetY, hyperlinkProducerFactory, isModeBatch, jasperPrint, jasperPrintList, numberFormatCache, parameters, PROPERTY_CELL_FORMULA, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, startPageIndex, urlHandlerFactory, urlHandlerFactorySet`

Constructor Summary
`JRDocxExporter()`

Method Summary
`protected void` | `endHyperlink(boolean isText)`
`protected void` | `exportEllipse(DocxTableHelper tableHelper, JRPrintEllipse ellipse, JRExporterGridCell gridCell)`
`protected void` | `exportFrame(DocxTableHelper tableHelper, JRPrintFrame frame, JRExporterGridCell gridCell)` In deep grids, this is called only for empty frames.
`protected void` | `exportGenericElement(DocxTableHelper tableHelper, JRGenericPrintElement element, JRExporterGridCell gridCell)`
`protected void` | `exportGrid(JRGridLayout gridLayout, JRPrintElementIndex frameIndex)`
`protected void` | `exportImage(DocxTableHelper tableHelper, JRPrintImage image, JRExporterGridCell gridCell)`
`protected void` | `exportLine(DocxTableHelper tableHelper, JRPrintLine line, JRExporterGridCell gridCell)`
`protected void` | `exportPage(JRPrintPage page)`
`protected void` | `exportRectangle(DocxTableHelper tableHelper, JRPrintRectangle rectangle, JRExporterGridCell gridCell)`
`void` | `exportReport()` Actually starts the export process.
`protected void` | `exportReportToStream(java.io.OutputStream os)`
`protected void` | `exportStyledText(JRStyle style, JRStyledText styledText, java.util.Locale locale, boolean hiddenText)`
`void` | `exportText(DocxTableHelper tableHelper, JRPrintText text, JRExporterGridCell gridCell)`
`protected JRPrintElementIndex` | `getElementIndex(JRExporterGridCell gridCell)`
`protected java.lang.String` | `getExporterKey()`
`protected ExporterNature` | `getExporterNature(ExporterFilter filter)`
`protected java.lang.String` | `getExporterPropertiesPrefix()`
`protected java.lang.String` | `getHyperlinkTarget(JRPrintHyperlink link)`
`protected java.lang.String` | `getHyperlinkURL(JRPrintHyperlink link)`
`static JRPrintImage` | `getImage(java.util.List jasperPrintList, JRPrintElementIndex imageIndex)`
`static JRPrintImage` | `getImage(java.util.List jasperPrintList, java.lang.String imageName)`
`static java.lang.String` | `getImageName(JRPrintElementIndex printElementIndex)` protected void writeImageMap(String imageMapName, JRPrintHyperlink mainHyperlink, List imageMapAreas) { writer.write("\n"); for (Iterator it = imageMapAreas.iterator(); it.hasNext();) { JRPrintImageAreaHyperlink areaHyperlink = (JRPrintImageAreaHyperlink) it.next(); JRPrintImageArea area = areaHyperlink.getArea(); writer.write(" \n"); } if (mainHyperlink.getHyperlinkTypeValue() !
`protected java.lang.String` | `getImagePath(JRRenderable renderer, boolean isLazy, JRExporterGridCell gridCell)`
`static JRPrintElementIndex` | `getPrintElementIndex(java.lang.String imageName)`
`protected void` | `restoreBackcolor()`
`protected void` | `setBackcolor(java.awt.Color color)`
`protected void` | `setInput()`
`protected boolean` | `startHyperlink(JRPrintHyperlink link, boolean isText)`

Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
`createFilter, defaultParseNumber, getBooleanCellValue, getBooleanParameter, getCharacterParameter, getCustomHandler, getDateCellValue, getDateFormat, getFloatParameter, getHyperlinkProducer, getIntegerParameter, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getParameter, getParameterResolver, getParameters, getStringArrayParameter, getStringParameter, getStringParameterOrDefault, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setExportContext, setFrameElementsOffset, setHyperlinkProducerFactory, setJasperPrint, setOffset, setOffset, setOutput, setPageRange, setParameter, setParameters`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DOCX_EXPORTER_KEY

    public static final java.lang.String DOCX_EXPORTER_KEY

  The exporter key, as used in `GenericElementHandlerEnviroment.getHandler(net.sf.jasperreports.engine.JRGenericElementType, String)`.

  See Also:
    Constant Field Values

### DOCX_EXPORTER_PROPERTIES_PREFIX

    protected static final java.lang.String DOCX_EXPORTER_PROPERTIES_PREFIX

See Also:
  Constant Field Values

### PROPERTY_HIDDEN_TEXT

    public static final java.lang.String PROPERTY_HIDDEN_TEXT

  This property is used to mark text elements as being hidden either for printing or on-screen display.

  See Also:
    `JRProperties`, Constant Field Values

### JR_PAGE_ANCHOR_PREFIX

    protected static final java.lang.String JR_PAGE_ANCHOR_PREFIX

See Also:
  Constant Field Values

### IMAGE_NAME_PREFIX

    public static final java.lang.String IMAGE_NAME_PREFIX

See Also:
  Constant Field Values

### IMAGE_NAME_PREFIX_LEGTH

    protected static final int IMAGE_NAME_PREFIX_LEGTH

### docHelper

    protected DocxDocumentHelper docHelper

### docWriter

    protected java.io.Writer docWriter

### progressMonitor

    protected JRExportProgressMonitor progressMonitor

### rendererToImagePathMap

    protected java.util.Map rendererToImagePathMap

### imageMaps

    protected java.util.Map imageMaps

### imagesToProcess

    protected java.util.List imagesToProcess

### reportIndex

    protected int reportIndex

### pageIndex

    protected int pageIndex

### tableIndex

    protected int tableIndex

### startPage

    protected boolean startPage

### fontMap

    protected java.util.Map fontMap

  Deprecated.

### backcolorStack

    protected java.util.LinkedList backcolorStack

### backcolor

    protected java.awt.Color backcolor

### nature

    protected ExporterNature nature

### deepGrid

    protected boolean deepGrid

### flexibleRowHeight

    protected boolean flexibleRowHeight

Constructor Detail

### JRDocxExporter

    public JRDocxExporter()

Method Detail

### exportReport

    public void exportReport()
                      throws JRException

  Description copied from interface: `JRExporter`
  Actually starts the export process.

  Specified by:
    `exportReport` in interface `JRExporter`
  Specified by:
    `exportReport` in class `JRAbstractExporter`
  Throws:
    `JRException`

### getImage

    public static JRPrintImage getImage(java.util.List jasperPrintList,
                                        java.lang.String imageName)

### getImage

    public static JRPrintImage getImage(java.util.List jasperPrintList,
                                        JRPrintElementIndex imageIndex)

### exportReportToStream

    protected void exportReportToStream(java.io.OutputStream os)
                                 throws JRException,
                                        java.io.IOException

  Throws:
    `JRException`
    `java.io.IOException`

### exportPage

    protected void exportPage(JRPrintPage page)
                       throws JRException

  Throws:
    `JRException`

### exportGrid

    protected void exportGrid(JRGridLayout gridLayout,
                              JRPrintElementIndex frameIndex)
                       throws JRException

  Throws:
    `JRException`

### exportLine

    protected void exportLine(DocxTableHelper tableHelper,
                              JRPrintLine line,
                              JRExporterGridCell gridCell)

### exportRectangle

    protected void exportRectangle(DocxTableHelper tableHelper,
                                   JRPrintRectangle rectangle,
                                   JRExporterGridCell gridCell)

### exportEllipse

    protected void exportEllipse(DocxTableHelper tableHelper,
                                 JRPrintEllipse ellipse,
                                 JRExporterGridCell gridCell)

### exportText

    public void exportText(DocxTableHelper tableHelper,
                           JRPrintText text,
                           JRExporterGridCell gridCell)

### exportStyledText

    protected void exportStyledText(JRStyle style,
                                    JRStyledText styledText,
                                    java.util.Locale locale,
                                    boolean hiddenText)

### exportImage

    protected void exportImage(DocxTableHelper tableHelper,
                               JRPrintImage image,
                               JRExporterGridCell gridCell)
                        throws JRException

  Throws:
    `JRException`

### getImagePath

    protected java.lang.String getImagePath(JRRenderable renderer,
                                            boolean isLazy,
                                            JRExporterGridCell gridCell)

### getElementIndex

    protected JRPrintElementIndex getElementIndex(JRExporterGridCell gridCell)

### getImageName

    public static java.lang.String getImageName(JRPrintElementIndex printElementIndex)

  protected void writeImageMap(String imageMapName, JRPrintHyperlink mainHyperlink, List imageMapAreas) { writer.write("\n"); for (Iterator it = imageMapAreas.iterator(); it.hasNext();) { JRPrintImageAreaHyperlink areaHyperlink = (JRPrintImageAreaHyperlink) it.next(); JRPrintImageArea area = areaHyperlink.getArea(); writer.write(" \n"); } if (mainHyperlink.getHyperlinkTypeValue() != NONE) { writer.write(" \n"); } writer.write("\n"); } protected void writeImageAreaCoordinates(JRPrintImageArea area) { int[] coords = area.getCoordinates(); if (coords != null && coords.length > 0) { StringBuffer coordsEnum = new StringBuffer(coords.length * 4); coordsEnum.append(coords[0]); for (int i = 1; i < coords.length; i++) { coordsEnum.append(','); coordsEnum.append(coords[i]); } writer.write(" coords=\"" + coordsEnum + "\""); } } protected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink) { String href = getHyperlinkURL(hyperlink); if (href == null) { writer.write(" nohref=\"nohref\""); } else { writer.write(" href=\"" + href + "\""); String target = getHyperlinkTarget(hyperlink); if (target != null) { writer.write(" target=\""); writer.write(target); writer.write("\""); } } if (hyperlink.getHyperlinkTooltip() != null) { writer.write(" title=\""); writer.write(JRStringUtil.xmlEncode(hyperlink.getHyperlinkTooltip())); writer.write("\""); } } /**

### getPrintElementIndex

    public static JRPrintElementIndex getPrintElementIndex(java.lang.String imageName)

### exportFrame

    protected void exportFrame(DocxTableHelper tableHelper,
                               JRPrintFrame frame,
                               JRExporterGridCell gridCell)
                        throws JRException

  In deep grids, this is called only for empty frames.

  Throws:
    `JRException`

### exportGenericElement

    protected void exportGenericElement(DocxTableHelper tableHelper,
                                        JRGenericPrintElement element,
                                        JRExporterGridCell gridCell)

### setBackcolor

    protected void setBackcolor(java.awt.Color color)

### restoreBackcolor

    protected void restoreBackcolor()

### startHyperlink

    protected boolean startHyperlink(JRPrintHyperlink link,
                                     boolean isText)

### getHyperlinkTarget

    protected java.lang.String getHyperlinkTarget(JRPrintHyperlink link)

### getHyperlinkURL

    protected java.lang.String getHyperlinkURL(JRPrintHyperlink link)

### endHyperlink

    protected void endHyperlink(boolean isText)

### setInput

    protected void setInput()
                     throws JRException

  Overrides:
    `setInput` in class `JRAbstractExporter`
  Throws:
    `JRException`

### getExporterNature

    protected ExporterNature getExporterNature(ExporterFilter filter)

### getExporterPropertiesPrefix

    protected java.lang.String getExporterPropertiesPrefix()

### getExporterKey

    protected java.lang.String getExporterKey()

  Specified by:
    `getExporterKey` in class `JRAbstractExporter`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com