net.sf.jasperreports.engine.export.oasis

## Class JROdsExporter

- java.lang.Object
- - net.sf.jasperreports.engine.JRAbstractExporter<RC,C,OutputStreamExporterOutput,E>
  - - net.sf.jasperreports.engine.export.JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>
    - - net.sf.jasperreports.engine.export.oasis.JROdsExporter

- All Implemented Interfaces:
    JRExporter<ExporterInput,OdsReportConfiguration,OdsExporterConfiguration,OutputStreamExporterOutput>, Exporter<ExporterInput,OdsReportConfiguration,OdsExporterConfiguration,OutputStreamExporterOutput>

      public class JROdsExporter
      extends JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>

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

  The `JROdsExporter` exporter implementation produces documents that comply with the Open Document Format for Office Applications specifications for spreadsheets. These documents use the `.ods` file extension.

  Because spreadsheet documents are made of sheets containing cells, this exporter is a grid exporter, as well, therefore having the known limitations of grid exporters.

  Special exporter configuration settings, that can be applied to a `JROdsExporter` instance to control its behavior, can be found in `OdsReportConfiguration` and in its `XlsReportConfiguration` superclass.
  Version:
    $Id: JROdsExporter.java 7067 2014-04-30 09:32:46Z shertage $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)
  See Also:
    `OdsReportConfiguration`, `XlsReportConfiguration`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `JROdsExporter.ExporterContext`
    `protected class` | `JROdsExporter.OdsDocumentBuilder`
    `protected class` | `JROdsExporter.OdsTableBuilder`

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

      `JRXlsAbstractExporter.SheetInfo, JRXlsAbstractExporter.TextAlignHolder`

    - ### 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.util.Map<java.lang.Integer,java.lang.String>` | `columnStyles`
    `protected static java.lang.String` | `DEFAULT_ADDRESS`
    `protected static java.lang.String` | `DEFAULT_COLUMN`
    `protected DocumentBuilder` | `documentBuilder`
    `protected static java.lang.String` | `JR_PAGE_ANCHOR_PREFIX`
    `protected java.lang.StringBuffer` | `namedExpressions`
    `protected OasisZip` | `oasisZip`
    `static java.lang.String` | `ODS_EXPORTER_KEY` The exporter key, as used in `GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)`.
    `protected static java.lang.String` | `ODS_EXPORTER_PROPERTIES_PREFIX`
    `protected java.util.Map<java.lang.Integer,java.lang.String>` | `rowStyles`
    `protected boolean` | `startPage`
    `protected StyleCache` | `styleCache`
    `protected TableBuilder` | `tableBuilder`
    `protected ExportZipEntry` | `tempBodyEntry`
    `protected WriterHelper` | `tempBodyWriter`
    `protected ExportZipEntry` | `tempStyleEntry`
    `protected WriterHelper` | `tempStyleWriter`

    - ### Fields inherited from class net.sf.jasperreports.engine.export.JRXlsAbstractExporter

      `autoFilterEnd, autoFilterStart, DEFAULT_SHEET_NAME_PREFIX, defaultFont, firstPageNotSet, gridColumnFreezeIndex, gridRowFreezeIndex, invalidCharReplacement, isFreezeColumnEdge, isFreezeRowEdge, keepTemplateSheets, loadedFonts, maxColumnFreezeIndex, maxRowFreezeIndex, nature, onePagePerSheetMap, pageIndex, PROPERTY_AUTO_FILTER, PROPERTY_AUTO_FIT_COLUMN, PROPERTY_AUTO_FIT_ROW, PROPERTY_BREAK_AFTER_ROW, PROPERTY_BREAK_BEFORE_ROW, PROPERTY_CELL_FORMULA, PROPERTY_CELL_HIDDEN, PROPERTY_CELL_LOCKED, PROPERTY_CELL_PATTERN, PROPERTY_COLUMN_WIDTH, PROPERTY_COLUMN_WIDTH_RATIO, PROPERTY_FIRST_PAGE_NUMBER, PROPERTY_FIT_HEIGHT, PROPERTY_FIT_WIDTH, PROPERTY_FREEZE_COLUMN, PROPERTY_FREEZE_COLUMN_EDGE, PROPERTY_FREEZE_ROW, PROPERTY_FREEZE_ROW_EDGE, PROPERTY_IGNORE_ANCHORS, PROPERTY_IGNORE_HYPERLINK, PROPERTY_IMAGE_ANCHOR_TYPE, PROPERTY_PAGE_SCALE, PROPERTY_ROW_OUTLINE_LEVEL_PREFIX, PROPERTY_SHEET_DIRECTION, PROPERTY_SHEET_FOOTER_CENTER, PROPERTY_SHEET_FOOTER_LEFT, PROPERTY_SHEET_FOOTER_RIGHT, PROPERTY_SHEET_HEADER_CENTER, PROPERTY_SHEET_HEADER_LEFT, PROPERTY_SHEET_HEADER_RIGHT, PROPERTY_SHEET_NAME, PROPERTY_SHOW_GRIDLINES, PROPERTY_USE_TIMEZONE, PROPERTY_WORKBOOK_TEMPLATE, PROPERTY_WORKBOOK_TEMPLATE_KEEP_SHEETS, PROPERTY_WRAP_TEXT, reportIndex, sheetIndex, sheetNames, sheetNamesIndex, sheetNamesMap, sheetsBeforeCurrentReport, sheetsBeforeCurrentReportMap, workbookTemplate, XLS_EXPORTER_PROPERTIES_PREFIX`

    - ### 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
    `JROdsExporter()`
    `JROdsExporter(JasperReportsContext jasperReportsContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addBlankCell(JRExporterGridCell gridCell, int colIndex, int rowIndex)`
    `protected void` | `addOccupiedCell(OccupiedGridCell occupiedGridCell, int colIndex, int rowIndex)`
    `protected void` | `closeSheet()`
    `protected void` | `closeWorkbook(java.io.OutputStream os)`
    `protected void` | `createSheet(CutsInfo xCuts, JRXlsAbstractExporter.SheetInfo sheetInfo)`
    `protected void` | `exportFrame(JRPrintFrame frame, JRExporterGridCell cell, int colIndex, int rowIndex)`
    `protected void` | `exportGenericElement(JRGenericPrintElement element, JRExporterGridCell gridCell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout)`
    `void` | `exportImage(JRPrintImage image, JRExporterGridCell gridCell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout)`
    `protected void` | `exportLine(JRPrintLine line, JRExporterGridCell gridCell, int colIndex, int rowIndex)`
    `protected void` | `exportRectangle(JRPrintGraphicElement rectangle, JRExporterGridCell gridCell, int colIndex, int rowIndex)`
    `void` | `exportText(JRPrintText text, JRExporterGridCell gridCell, int colIndex, int rowIndex)`
    `protected java.lang.String` | `getCellAddress(int row, int col)`
    `protected java.lang.String` | `getColumnName(int colIndex)`
    `protected java.lang.Class<OdsExporterConfiguration>` | `getConfigurationInterface()`
    `java.lang.String` | `getExporterKey()`
    `java.lang.String` | `getExporterPropertiesPrefix()` Returns the properties prefix for the current exporter.
    `protected java.lang.Class<OdsReportConfiguration>` | `getItemConfigurationInterface()`
    `protected void` | `initExport()`
    `protected void` | `initReport()`
    `protected void` | `insertPageAnchor(TableBuilder tableBuilder)`
    `protected void` | `openWorkbook(java.io.OutputStream os)`
    `protected void` | `setAutoFilter(java.lang.String autoFilterRange)`
    `protected void` | `setColumnWidth(int col, int width, boolean autoFit)`
    `protected void` | `setFreezePane(int rowIndex, int colIndex, boolean isRowEdge, boolean isColumnEdge)`
    `protected void` | `setRowHeight(int rowIndex, int lastRowHeight, Cut yCut, XlsRowLevelInfo levelInfo)`
    `protected void` | `setRowLevels(XlsRowLevelInfo levelInfo, java.lang.String level)`
    `protected void` | `setScale(java.lang.Integer scale)`
    `protected void` | `setSheetName(java.lang.String sheetName)`

    - ### Methods inherited from class net.sf.jasperreports.engine.export.JRXlsAbstractExporter

      `calculateHeightForDinAN, calculateHeightForDinBN, calculateHeightForDinCN, calculateWidthForDinAN, calculateWidthForDinBN, calculateWidthForDinCN, ensureOutput, exportPage, exportReport, exportReportToStream, exportSheet, getColumnIndex, getConvertedPattern, getDefaultFont, getFormula, getImageBorderCorrection, getNature, getSheetProps, getStyledText, getTextAlignHolder, getWorkbookTemplate, hasGlobalSheetNames, isCellHidden, isCellLocked, isUseTimeZone, isValidScale, isWorkbookTemplateKeepSheets, isWrapText, mergeAndSetRowLevels, resetAutoFilters, setColumnWidths, setFreezePane, setSheetNames, setWorkbookTemplate, setWorkbookTemplateKeepSheets, translateDateValue`

    - ### 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, 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

    - #### JR_PAGE_ANCHOR_PREFIX

          protected static final java.lang.String JR_PAGE_ANCHOR_PREFIX

      See Also:
        Constant Field Values

    - #### DEFAULT_COLUMN

          protected static final java.lang.String DEFAULT_COLUMN

      See Also:
        Constant Field Values

    - #### DEFAULT_ADDRESS

          protected static final java.lang.String DEFAULT_ADDRESS

      See Also:
        Constant Field Values

    - #### oasisZip

          protected OasisZip oasisZip

    - #### tempBodyEntry

          protected ExportZipEntry tempBodyEntry

    - #### tempStyleEntry

          protected ExportZipEntry tempStyleEntry

    - #### tempBodyWriter

          protected WriterHelper tempBodyWriter

    - #### tempStyleWriter

          protected WriterHelper tempStyleWriter

    - #### styleCache

          protected StyleCache styleCache

    - #### documentBuilder

          protected DocumentBuilder documentBuilder

    - #### tableBuilder

          protected TableBuilder tableBuilder

    - #### startPage

          protected boolean startPage

    - #### namedExpressions

          protected java.lang.StringBuffer namedExpressions

    - #### rowStyles

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

    - #### columnStyles

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

    - #### ODS_EXPORTER_PROPERTIES_PREFIX

          protected static final java.lang.String ODS_EXPORTER_PROPERTIES_PREFIX

      See Also:
        Constant Field Values

    - #### ODS_EXPORTER_KEY

          public static final java.lang.String ODS_EXPORTER_KEY

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

  - ### Constructor Detail

    - #### JROdsExporter

          public JROdsExporter()

      See Also:
        `JROdsExporter(JasperReportsContext)`

    - #### JROdsExporter

          public JROdsExporter(JasperReportsContext jasperReportsContext)

  - ### Method Detail

    - #### openWorkbook

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

      Specified by:
        `openWorkbook` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`
        `java.io.IOException`

    - #### createSheet

          protected void createSheet(CutsInfo xCuts,
                         JRXlsAbstractExporter.SheetInfo sheetInfo)

      Specified by:
        `createSheet` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### closeSheet

          protected void closeSheet()

    - #### closeWorkbook

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

      Specified by:
        `closeWorkbook` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`
        `java.io.IOException`

    - #### setColumnWidth

          protected void setColumnWidth(int col,
                            int width,
                            boolean autoFit)

      Specified by:
        `setColumnWidth` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### setRowHeight

          protected void setRowHeight(int rowIndex,
                          int lastRowHeight,
                          Cut yCut,
                          XlsRowLevelInfo levelInfo)
                               throws JRException

      Specified by:
        `setRowHeight` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`

    - #### addBlankCell

          protected void addBlankCell(JRExporterGridCell gridCell,
                          int colIndex,
                          int rowIndex)

      Specified by:
        `addBlankCell` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### addOccupiedCell

          protected void addOccupiedCell(OccupiedGridCell occupiedGridCell,
                             int colIndex,
                             int rowIndex)
                                  throws JRException

      Specified by:
        `addOccupiedCell` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`

    - #### exportText

          public void exportText(JRPrintText text,
                        JRExporterGridCell gridCell,
                        int colIndex,
                        int rowIndex)
                          throws JRException

      Specified by:
        `exportText` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`

    - #### exportImage

          public void exportImage(JRPrintImage image,
                         JRExporterGridCell gridCell,
                         int colIndex,
                         int rowIndex,
                         int emptyCols,
                         int yCutsRow,
                         JRGridLayout layout)
                           throws JRException

      Specified by:
        `exportImage` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`

    - #### getCellAddress

          protected java.lang.String getCellAddress(int row,
                                        int col)

    - #### getColumnName

          protected java.lang.String getColumnName(int colIndex)

      Overrides:
        `getColumnName` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Returns:
        the calculated column name

    - #### exportRectangle

          protected void exportRectangle(JRPrintGraphicElement rectangle,
                             JRExporterGridCell gridCell,
                             int colIndex,
                             int rowIndex)
                                  throws JRException

      Specified by:
        `exportRectangle` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`

    - #### exportLine

          protected void exportLine(JRPrintLine line,
                        JRExporterGridCell gridCell,
                        int colIndex,
                        int rowIndex)
                             throws JRException

      Specified by:
        `exportLine` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`

    - #### exportFrame

          protected void exportFrame(JRPrintFrame frame,
                         JRExporterGridCell cell,
                         int colIndex,
                         int rowIndex)
                              throws JRException

      Specified by:
        `exportFrame` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`

    - #### exportGenericElement

          protected void exportGenericElement(JRGenericPrintElement element,
                                  JRExporterGridCell gridCell,
                                  int colIndex,
                                  int rowIndex,
                                  int emptyCols,
                                  int yCutsRow,
                                  JRGridLayout layout)
                                       throws JRException

      Specified by:
        `exportGenericElement` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`
      Throws:
        `JRException`

    - #### setFreezePane

          protected void setFreezePane(int rowIndex,
                           int colIndex,
                           boolean isRowEdge,
                           boolean isColumnEdge)

      Specified by:
        `setFreezePane` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### setSheetName

          protected void setSheetName(java.lang.String sheetName)

      Specified by:
        `setSheetName` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### setAutoFilter

          protected void setAutoFilter(java.lang.String autoFilterRange)

      Specified by:
        `setAutoFilter` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### setRowLevels

          protected void setRowLevels(XlsRowLevelInfo levelInfo,
                          java.lang.String level)

      Specified by:
        `setRowLevels` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### setScale

          protected void setScale(java.lang.Integer scale)

      Specified by:
        `setScale` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### getConfigurationInterface

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

      Specified by:
        `getConfigurationInterface` in class `JRAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,OutputStreamExporterOutput,JROdsExporterContext>`

    - #### getItemConfigurationInterface

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

      Specified by:
        `getItemConfigurationInterface` in class `JRAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,OutputStreamExporterOutput,JROdsExporterContext>`

    - #### initExport

          protected void initExport()

      Overrides:
        `initExport` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### initReport

          protected void initReport()

      Overrides:
        `initReport` in class `JRXlsAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,JROdsExporterContext>`

    - #### getExporterKey

          public java.lang.String getExporterKey()

      Specified by:
        `getExporterKey` in class `JRAbstractExporter<OdsReportConfiguration,OdsExporterConfiguration,OutputStreamExporterOutput,JROdsExporterContext>`

    - #### 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<OdsReportConfiguration,OdsExporterConfiguration,OutputStreamExporterOutput,JROdsExporterContext>`
      Returns:
        the properties prefix for the current exporter

    - #### insertPageAnchor

          protected void insertPageAnchor(TableBuilder tableBuilder)

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com