net.sf.jasperreports.engine.export.oasis

## Class JROdtExporter

- java.lang.Object
- - net.sf.jasperreports.engine.JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>
  - - net.sf.jasperreports.engine.export.oasis.JROdtExporter

- All Implemented Interfaces:
    JRExporter<ExporterInput,OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput>, Exporter<ExporterInput,OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput>

      public class JROdtExporter
      extends JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>

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

  Open Document Format (short for OASIS Open Document Format for Office Applications) describes electronic documents such as memos, spreadsheets, books, charts, presentations, and word processing documents. `.odt` is the file extension used for the word processing documents in the Open Document Format, and such files can be obtained in JasperReports using the `JROdtExporter` class.

  Currently, there are the following special configurations that can be applied to an ODT exporter instance (see `DocxReportConfiguration`) to customize its behavior:
  - Allowing table rows to adjust their height if more text is typed into their cells using the ODT editor. This is controlled using either the `isFlexibleRowHeight()` exporter configuration flag, or its corresponding exporter hint called `net.sf.jasperreports.export.odt.flexible.row.height`.
  - Ignoring hyperlinks in generated documents if they are not intended for the ODT output format. This can be customized using either the `isIgnoreHyperlink()` exporter configuration flag, or its corresponding exporter hint called `net.sf.jasperreports.export.odt.ignore.hyperlinks`

  So far, the ODT exporter has the known limitations of grid exporters. It can work in batch mode and supports all types of exporter input and output as well as font mappings.
  Version:
    $Id: JROdtExporter.java 7067 2014-04-30 09:32:46Z shertage $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)
  See Also:
    `OdtReportConfiguration`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `JROdtExporter.ExporterContext`
    `protected class` | `JROdtExporter.OdtDocumentBuilder`

    - ### Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter

      `JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.awt.Color` | `backcolor`
    `protected java.util.LinkedList<java.awt.Color>` | `backcolorStack`
    `protected java.util.Map<java.lang.Integer,java.lang.String>` | `columnStyles`
    `protected DocumentBuilder` | `documentBuilder`
    `protected java.lang.String` | `invalidCharReplacement`
    `protected ExporterNature` | `nature`
    `static java.lang.String` | `ODT_EXPORTER_KEY` The exporter key, as used in `GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)`.
    `protected static java.lang.String` | `ODT_EXPORTER_PROPERTIES_PREFIX`
    `protected int` | `pageIndex`
    `static java.lang.String` | `PROPERTY_IGNORE_HYPERLINK` Deprecated. Replaced by `OdtReportConfiguration.PROPERTY_IGNORE_HYPERLINK`.
    `protected int` | `reportIndex`
    `protected java.util.Map<java.lang.Integer,java.lang.String>` | `rowStyles`
    `protected boolean` | `startPage`
    `protected StyleCache` | `styleCache`
    `protected int` | `tableIndex`
    `protected WriterHelper` | `tempBodyWriter`
    `protected WriterHelper` | `tempStyleWriter`

    - ### Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter

      `allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE, exporterConfiguration, exporterContext, exporterInput, exporterOutput, filter, itemConfiguration, jasperPrint, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, styledTextUtil`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JROdtExporter()`
    `JROdtExporter(JasperReportsContext jasperReportsContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `ensureOutput()`
    `protected void` | `exportEllipse(TableBuilder tableBuilder, JRPrintEllipse ellipse, JRExporterGridCell gridCell)`
    `protected void` | `exportFrame(TableBuilder tableBuilder, JRPrintFrame frame, JRExporterGridCell gridCell)`
    `protected void` | `exportGenericElement(TableBuilder tableBuilder, JRGenericPrintElement element, JRExporterGridCell gridCell)`
    `protected void` | `exportGrid(JRGridLayout gridLayout, JRPrintElementIndex frameIndex)`
    `void` | `exportImage(TableBuilder tableBuilder, JRPrintImage image, JRExporterGridCell gridCell)`
    `protected void` | `exportLine(TableBuilder tableBuilder, JRPrintLine line, JRExporterGridCell gridCell)`
    `protected void` | `exportPage(JRPrintPage page)`
    `protected void` | `exportRectangle(TableBuilder tableBuilder, JRPrintRectangle rectangle, JRExporterGridCell gridCell)`
    `void` | `exportReport()` Performs the export.
    `protected void` | `exportReportToOasisZip(java.io.OutputStream os)`
    `void` | `exportText(TableBuilder tableBuilder, JRPrintText text, JRExporterGridCell gridCell)`
    `protected java.lang.Class<OdtExporterConfiguration>` | `getConfigurationInterface()`
    `java.lang.String` | `getExporterKey()`
    `java.lang.String` | `getExporterPropertiesPrefix()` Returns the properties prefix for the current exporter.
    `protected java.lang.Class<OdtReportConfiguration>` | `getItemConfigurationInterface()`
    `protected void` | `initExport()`
    `protected void` | `initReport()`
    `protected void` | `insertPageAnchor(TableBuilder tableBuilder)`
    `protected void` | `restoreBackcolor()`
    `protected void` | `setBackcolor(java.awt.Color color)`

    - ### Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter

      `createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, getBooleanCellValue, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getCustomHandler, getDateCellValue, getDateFormat, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getParameter, getParameters, getPropertiesUtil, getReportContext, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperPrint, setJasperReportsContext, setOffset, setOffset, setParameter, setParameters, setReportContext`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ODT_EXPORTER_KEY

          public static final java.lang.String ODT_EXPORTER_KEY

      The exporter key, as used in `GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)`.
      See Also:
        Constant Field Values

    - #### ODT_EXPORTER_PROPERTIES_PREFIX

          protected static final java.lang.String ODT_EXPORTER_PROPERTIES_PREFIX

      See Also:
        Constant Field Values

    - #### PROPERTY_IGNORE_HYPERLINK

          public static final java.lang.String PROPERTY_IGNORE_HYPERLINK

      Deprecated. Replaced by `OdtReportConfiguration.PROPERTY_IGNORE_HYPERLINK`.
      See Also:
        Constant Field Values

    - #### tempBodyWriter

          protected WriterHelper tempBodyWriter

    - #### tempStyleWriter

          protected WriterHelper tempStyleWriter

    - #### reportIndex

          protected int reportIndex

    - #### pageIndex

          protected int pageIndex

    - #### tableIndex

          protected int tableIndex

    - #### startPage

          protected boolean startPage

    - #### invalidCharReplacement

          protected java.lang.String invalidCharReplacement

    - #### backcolorStack

          protected java.util.LinkedList<java.awt.Color> backcolorStack

    - #### backcolor

          protected java.awt.Color backcolor

    - #### documentBuilder

          protected DocumentBuilder documentBuilder

    - #### styleCache

          protected StyleCache styleCache

    - #### nature

          protected ExporterNature nature

    - #### rowStyles

          protected java.util.Map<java.lang.Integer,java.lang.String> rowStyles

    - #### columnStyles

          protected java.util.Map<java.lang.Integer,java.lang.String> columnStyles

  - ### Constructor Detail

    - #### JROdtExporter

          public JROdtExporter()

      See Also:
        `JROdtExporter(JasperReportsContext)`

    - #### JROdtExporter

          public JROdtExporter(JasperReportsContext jasperReportsContext)

  - ### Method Detail

    - #### getConfigurationInterface

          protected java.lang.Class<OdtExporterConfiguration> getConfigurationInterface()

      Specified by:
        `getConfigurationInterface` in class `JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>`

    - #### getItemConfigurationInterface

          protected java.lang.Class<OdtReportConfiguration> getItemConfigurationInterface()

      Specified by:
        `getItemConfigurationInterface` in class `JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>`

    - #### ensureOutput

          protected void ensureOutput()

      Specified by:
        `ensureOutput` in class `JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>`

    - #### exportReport

          public void exportReport()
                            throws JRException

      Description copied from interface: `Exporter`
      Performs the export.
      Specified by:
        `exportReport` in interface `Exporter<ExporterInput,OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput>`
      Specified by:
        `exportReport` in class `JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>`
      Throws:
        `JRException`

    - #### initExport

          protected void initExport()

      Overrides:
        `initExport` in class `JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>`

    - #### initReport

          protected void initReport()

      Overrides:
        `initReport` in class `JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>`

    - #### exportReportToOasisZip

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

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

    - #### exportPage

          protected void exportPage(JRPrintPage page)
                             throws JRException,
                                    java.io.IOException

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

    - #### exportGrid

          protected void exportGrid(JRGridLayout gridLayout,
                        JRPrintElementIndex frameIndex)
                             throws java.io.IOException,
                                    JRException

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

    - #### exportFrame

          protected void exportFrame(TableBuilder tableBuilder,
                         JRPrintFrame frame,
                         JRExporterGridCell gridCell)
                              throws java.io.IOException,
                                     JRException

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

    - #### setBackcolor

          protected void setBackcolor(java.awt.Color color)

    - #### restoreBackcolor

          protected void restoreBackcolor()

    - #### exportRectangle

          protected void exportRectangle(TableBuilder tableBuilder,
                             JRPrintRectangle rectangle,
                             JRExporterGridCell gridCell)

    - #### exportLine

          protected void exportLine(TableBuilder tableBuilder,
                        JRPrintLine line,
                        JRExporterGridCell gridCell)

    - #### exportEllipse

          protected void exportEllipse(TableBuilder tableBuilder,
                           JRPrintEllipse ellipse,
                           JRExporterGridCell gridCell)

    - #### exportText

          public void exportText(TableBuilder tableBuilder,
                        JRPrintText text,
                        JRExporterGridCell gridCell)

    - #### exportImage

          public void exportImage(TableBuilder tableBuilder,
                         JRPrintImage image,
                         JRExporterGridCell gridCell)
                           throws JRException

      Throws:
        `JRException`

    - #### insertPageAnchor

          protected void insertPageAnchor(TableBuilder tableBuilder)

    - #### exportGenericElement

          protected void exportGenericElement(TableBuilder tableBuilder,
                                  JRGenericPrintElement element,
                                  JRExporterGridCell gridCell)
                                       throws java.io.IOException,
                                              JRException

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

    - #### getExporterKey

          public java.lang.String getExporterKey()

      Specified by:
        `getExporterKey` in class `JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>`

    - #### getExporterPropertiesPrefix

          public java.lang.String getExporterPropertiesPrefix()

      Description copied from class: `JRAbstractExporter`
      Returns the properties prefix for the current exporter.
      Specified by:
        `getExporterPropertiesPrefix` in class `JRAbstractExporter<OdtReportConfiguration,OdtExporterConfiguration,OutputStreamExporterOutput,JROdtExporterContext>`
      Returns:
        the properties prefix for the current exporter

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com