net.sf.jasperreports.engine.export

## Class JRXlsAbstractMetadataExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>

- java.lang.Object
- - net.sf.jasperreports.engine.JRAbstractExporter<RC,C,OutputStreamExporterOutput,E>
  - - net.sf.jasperreports.engine.export.JRXlsAbstractExporter<RC,C,E>
    - - net.sf.jasperreports.engine.export.JRXlsAbstractMetadataExporter<RC,C,E>

- All Implemented Interfaces:
    JRExporter<ExporterInput,RC,C,OutputStreamExporterOutput>, Exporter<ExporterInput,RC,C,OutputStreamExporterOutput>
  Direct Known Subclasses:
    JExcelApiMetadataExporter, JRXlsMetadataExporter

      public abstract class JRXlsAbstractMetadataExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>
      extends JRXlsAbstractExporter<RC,C,E>

  Version:
    $Id: JRXlsAbstractMetadataExporter.java 6814 2014-01-16 09:28:37Z shertage $
  Author:
    sanda zaharia (shertage@users.sourceforge.net)

- - ### Nested Class Summary

    - ### 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.List<java.lang.String>` | `columnNames`
    `protected java.util.Map<java.lang.String,java.lang.Integer>` | `columnNamesMap`
    `static java.lang.String` | `PROPERTY_COLUMN_NAME` A string that represents the name for the column that should appear in the XLS export.
    `static java.lang.String` | `PROPERTY_DATA` Property that specifies what value to associate with `PROPERTY_COLUMN_NAME`.
    `static java.lang.String` | `PROPERTY_REPEAT_VALUE` Property that specifies whether the value associated with `PROPERTY_COLUMN_NAME` should be repeated or not when it is missing.
    `protected int` | `rowIndex`

    - ### 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
    `JRXlsAbstractMetadataExporter()`
    `JRXlsAbstractMetadataExporter(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 abstract void` | `closeWorkbook(java.io.OutputStream os)`
    `protected void` | `createSheet(CutsInfo xCuts, JRXlsAbstractExporter.SheetInfo sheetInfo)`
    `protected abstract void` | `createSheet(JRXlsAbstractExporter.SheetInfo sheetInfo)`
    `protected abstract void` | `exportFrame(JRPrintFrame frame)`
    `protected void` | `exportFrame(JRPrintFrame frame, JRExporterGridCell cell, int colIndex, int rowIndex)`
    `protected abstract void` | `exportGenericElement(JRGenericPrintElement element)`
    `protected void` | `exportGenericElement(JRGenericPrintElement element, JRExporterGridCell cell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout)`
    `abstract void` | `exportImage(JRPrintImage image)`
    `void` | `exportImage(JRPrintImage image, JRExporterGridCell cell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout)`
    `protected abstract void` | `exportLine(JRPrintLine line)`
    `protected void` | `exportLine(JRPrintLine line, JRExporterGridCell cell, int colIndex, int rowIndex)`
    `protected int` | `exportPage(JRPrintPage page)`
    `protected abstract void` | `exportRectangle(JRPrintGraphicElement element)`
    `protected void` | `exportRectangle(JRPrintGraphicElement element, JRExporterGridCell cell, int colIndex, int rowIndex)`
    `protected void` | `exportReportToStream(java.io.OutputStream os)`
    `protected abstract void` | `exportText(JRPrintText textElement)`
    `protected void` | `exportText(JRPrintText text, JRExporterGridCell cell, int colIndex, int rowIndex)`
    `protected java.lang.String` | `getFormula(JRPrintText text)`
    `protected int` | `getImageBorderCorrection(JRPen pen)`
    `protected abstract ExporterNature` | `getNature()`
    `protected JRStyledText` | `getStyledText(JRPrintText textElement)`
    `protected static JRXlsAbstractExporter.TextAlignHolder` | `getTextAlignHolder(JRPrintText textElement)`
    `protected void` | `initExport()`
    `protected void` | `initReport()`
    `protected boolean` | `isCellHidden(JRPrintElement element)`
    `protected boolean` | `isCellLocked(JRPrintElement element)`
    `protected boolean` | `isColumnReadOnTime(java.util.Map<java.lang.String,java.lang.Object> currentRow, java.lang.String currentColumnName)` Compares the highest index of the currentRow's columns with the index of the column to be inserted to determine if the current column is read in the proper order
    `protected boolean` | `isWrapText(JRPrintElement element)`
    `protected abstract void` | `openWorkbook(java.io.OutputStream os)`
    `protected void` | `setColumnNames()`
    `protected void` | `setColumnWidth(int col, int width)`
    `protected abstract void` | `setColumnWidth(int col, int width, boolean autoFit)`
    `protected void` | `setRowHeight(int rowIndex, int lastRowHeight)`
    `protected abstract void` | `setRowHeight(int rowIndex, int lastRowHeight, Cut yCut, XlsRowLevelInfo levelInfo)`
    `protected abstract void` | `writeCurrentRow(java.util.Map<java.lang.String,java.lang.Object> currentRow, java.util.Map<java.lang.String,java.lang.Object> repeatedValues)`

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

      `calculateHeightForDinAN, calculateHeightForDinBN, calculateHeightForDinCN, calculateWidthForDinAN, calculateWidthForDinBN, calculateWidthForDinCN, ensureOutput, exportPage, exportReport, exportSheet, getColumnIndex, getColumnName, getConvertedPattern, getDefaultFont, getSheetProps, getWorkbookTemplate, hasGlobalSheetNames, isUseTimeZone, isValidScale, isWorkbookTemplateKeepSheets, mergeAndSetRowLevels, resetAutoFilters, setAutoFilter, setColumnWidths, setFreezePane, setFreezePane, setRowLevels, setScale, setSheetName, setSheetNames, setWorkbookTemplate, setWorkbookTemplateKeepSheets, translateDateValue`

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

      `createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, getBooleanCellValue, getConfigurationInterface, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getCustomHandler, getDateCellValue, getDateFormat, getExporterContext, getExporterInput, getExporterKey, getExporterOutput, getExporterPropertiesPrefix, getHyperlinkProducer, getItemConfigurationInterface, 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

    - #### PROPERTY_COLUMN_NAME

          public static final java.lang.String PROPERTY_COLUMN_NAME

      A string that represents the name for the column that should appear in the XLS export. It must be one of the values in `XlsMetadataReportConfiguration.getColumnNames()`, if provided.
      See Also:
        `JRPropertiesUtil`, Constant Field Values

    - #### PROPERTY_REPEAT_VALUE

          public static final java.lang.String PROPERTY_REPEAT_VALUE

      Property that specifies whether the value associated with `PROPERTY_COLUMN_NAME` should be repeated or not when it is missing.

      The property itself defaults to `false`.

      See Also:
        `JRPropertiesUtil`, Constant Field Values

    - #### PROPERTY_DATA

          public static final java.lang.String PROPERTY_DATA

      Property that specifies what value to associate with `PROPERTY_COLUMN_NAME`.

      The property itself defaults to the text value of the report element that this property is assigned to.

      See Also:
        `JRPropertiesUtil`, Constant Field Values

    - #### columnNames

          protected java.util.List<java.lang.String> columnNames

    - #### columnNamesMap

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

    - #### rowIndex

          protected int rowIndex

  - ### Constructor Detail

    - #### JRXlsAbstractMetadataExporter

          public JRXlsAbstractMetadataExporter()

      See Also:
        `JRXlsAbstractMetadataExporter(JasperReportsContext)`

    - #### JRXlsAbstractMetadataExporter

          public JRXlsAbstractMetadataExporter(JasperReportsContext jasperReportsContext)

  - ### Method Detail

    - #### initExport

          protected void initExport()

      Overrides:
        `initExport` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### initReport

          protected void initReport()

      Overrides:
        `initReport` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### setColumnNames

          protected void setColumnNames()

    - #### exportReportToStream

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

      Overrides:
        `exportReportToStream` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### exportPage

          protected int exportPage(JRPrintPage page)
                            throws JRException

      Throws:
        `JRException`

    - #### getStyledText

          protected JRStyledText getStyledText(JRPrintText textElement)

      Overrides:
        `getStyledText` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### getTextAlignHolder

          protected static JRXlsAbstractExporter.TextAlignHolder getTextAlignHolder(JRPrintText textElement)

    - #### getImageBorderCorrection

          protected int getImageBorderCorrection(JRPen pen)

      Overrides:
        `getImageBorderCorrection` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### isWrapText

          protected boolean isWrapText(JRPrintElement element)

      Overrides:
        `isWrapText` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### isCellLocked

          protected boolean isCellLocked(JRPrintElement element)

      Overrides:
        `isCellLocked` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### getFormula

          protected java.lang.String getFormula(JRPrintText text)

      Overrides:
        `getFormula` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### isCellHidden

          protected boolean isCellHidden(JRPrintElement element)

      Overrides:
        `isCellHidden` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### isColumnReadOnTime

          protected boolean isColumnReadOnTime(java.util.Map<java.lang.String,java.lang.Object> currentRow,
                                   java.lang.String currentColumnName)

      Compares the highest index of the currentRow's columns with the index of the column to be inserted to determine if the current column is read in the proper order
      Parameters:
        `currentRow` -
        `currentColumnName` -

    - #### exportText

          protected void exportText(JRPrintText text,
                        JRExporterGridCell cell,
                        int colIndex,
                        int rowIndex)
                             throws JRException

      Specified by:
        `exportText` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### exportImage

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

      Specified by:
        `exportImage` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### exportRectangle

          protected void exportRectangle(JRPrintGraphicElement element,
                             JRExporterGridCell cell,
                             int colIndex,
                             int rowIndex)
                                  throws JRException

      Specified by:
        `exportRectangle` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### exportLine

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

      Specified by:
        `exportLine` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### exportFrame

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

      Specified by:
        `exportFrame` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### exportGenericElement

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

      Specified by:
        `exportGenericElement` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### addBlankCell

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

      Specified by:
        `addBlankCell` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### addOccupiedCell

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

      Specified by:
        `addOccupiedCell` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### getNature

          protected abstract ExporterNature getNature()

      Overrides:
        `getNature` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### openWorkbook

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

      Specified by:
        `openWorkbook` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### createSheet

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

      Specified by:
        `createSheet` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### createSheet

          protected abstract void createSheet(JRXlsAbstractExporter.SheetInfo sheetInfo)

    - #### closeWorkbook

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

      Specified by:
        `closeWorkbook` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### setColumnWidth

          protected void setColumnWidth(int col,
                            int width)

    - #### setColumnWidth

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

      Specified by:
        `setColumnWidth` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`

    - #### setRowHeight

          protected void setRowHeight(int rowIndex,
                          int lastRowHeight)
                               throws JRException

      Throws:
        `JRException`

    - #### setRowHeight

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

      Specified by:
        `setRowHeight` in class `JRXlsAbstractExporter<RC extends XlsMetadataReportConfiguration,C extends XlsMetadataExporterConfiguration,E extends JRExporterContext>`
      Throws:
        `JRException`

    - #### exportText

          protected abstract void exportText(JRPrintText textElement)
                                      throws JRException

      Throws:
        `JRException`

    - #### exportImage

          public abstract void exportImage(JRPrintImage image)
                                    throws JRException

      Throws:
        `JRException`

    - #### exportRectangle

          protected abstract void exportRectangle(JRPrintGraphicElement element)
                                           throws JRException

      Throws:
        `JRException`

    - #### exportLine

          protected abstract void exportLine(JRPrintLine line)
                                      throws JRException

      Throws:
        `JRException`

    - #### exportFrame

          protected abstract void exportFrame(JRPrintFrame frame)
                                       throws JRException

      Throws:
        `JRException`

    - #### exportGenericElement

          protected abstract void exportGenericElement(JRGenericPrintElement element)
                                                throws JRException

      Throws:
        `JRException`

    - #### writeCurrentRow

          protected abstract void writeCurrentRow(java.util.Map<java.lang.String,java.lang.Object> currentRow,
                             java.util.Map<java.lang.String,java.lang.Object> repeatedValues)
                                           throws JRException

      Throws:
        `JRException`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com