net.sf.jasperreports.engine.export
Class JRXlsAbstractExporter

java.lang.Object
  extended by net.sf.jasperreports.engine.JRAbstractExporter
      extended by net.sf.jasperreports.engine.export.JRXlsAbstractExporter
All Implemented Interfaces:
JRExporter
Direct Known Subclasses:
JExcelApiExporter, JRXlsAbstractMetadataExporter, JRXlsExporter, JRXlsxExporter

public abstract class JRXlsAbstractExporter
extends JRAbstractExporter

Version:
$Id: JRXlsAbstractExporter.java 5363 2012-05-10 11:17:17Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Nested Class Summary
protected static class JRXlsAbstractExporter.TextAlignHolder
           
 
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.ParameterOverriddenResolver, JRAbstractExporter.ParameterOverrideResolver, JRAbstractExporter.ParameterResolver
 
Field Summary
protected  java.lang.String autoFilterEnd
           
protected  java.lang.String autoFilterStart
           
protected  boolean cellHidden
           
protected  boolean cellLocked
           
protected  java.lang.Float columnWidthRatio
           
protected  boolean createCustomPalette
           
protected  JRFont defaultFont
           
protected  java.lang.Integer documentFirstPageNumber
           
protected  java.lang.Integer documentPageScale
           
protected  boolean firstPageNotSet
           
protected  java.util.Map<java.lang.String,java.lang.String> formatPatternsMap
           
protected  int gridColumnFreezeIndex
           
protected  int gridRowFreezeIndex
           
protected  boolean ignoreAnchors
           
protected  boolean isCollapseRowSpan
           
protected  boolean isDetectCellType
           
protected  boolean isFontSizeFixEnabled
           
protected  boolean isFreezeColumnEdge
           
protected  boolean isFreezeRowEdge
           
protected  boolean isIgnoreCellBackground
           
protected  boolean isIgnoreCellBorder
           
protected  boolean isIgnoreGraphics
           
protected  boolean isIgnorePageMargins
           
protected  boolean isImageBorderFixEnabled
           
protected  boolean isOnePagePerSheet
           
protected  boolean isRemoveEmptySpaceBetweenColumns
           
protected  boolean isRemoveEmptySpaceBetweenRows
           
protected  boolean isWhitePageBackground
           
protected  java.lang.Boolean keepTemplateSheets
           
protected  java.util.List<java.lang.Object> loadedFonts
           
protected  int maxColumnFreezeIndex
           
protected  int maxRowFreezeIndex
           
protected  int maxRowsPerSheet
           
protected  int pageIndex
           
protected  JRExportProgressMonitor progressMonitor
           
static java.lang.String PROPERTY_AUTO_FILTER
          This element-level property is used to indicate the boundaries of the autofilter data range in the current sheet.
static java.lang.String PROPERTY_AUTO_FIT_COLUMN
          Flag property that indicates whether Excel should autofit the current column width.
static java.lang.String PROPERTY_AUTO_FIT_ROW
          Flag property that indicates whether Excel should autofit the current row height.
static java.lang.String PROPERTY_CELL_FORMULA
          Property that stores the formula which has to be applied to a given cell in an excel sheet.
static java.lang.String PROPERTY_CELL_HIDDEN
          This property indicates whether the cell content is hidden.
static java.lang.String PROPERTY_CELL_LOCKED
          This property indicates whether the cell is locked.
static java.lang.String PROPERTY_CELL_PATTERN
          Property that stores the pattern which has to be applied to a given cell in an excel sheet.
static java.lang.String PROPERTY_COLUMN_WIDTH
          Element-level property used to adjust the column width to values suitable for Excel output, taking into account that column widths are measured in Excel in Normal style default character width units.
static java.lang.String PROPERTY_COLUMN_WIDTH_RATIO
          Property used to adjust all column widths in a document or sheet with the same width ratio, in order to get column width values suitable for Excel output.
static java.lang.String PROPERTY_FIRST_PAGE_NUMBER
          Property that specifies the first page number in the page setup dialog.
static java.lang.String PROPERTY_FIT_HEIGHT
          This property indicates the number of pages height to fit the sheet in.
static java.lang.String PROPERTY_FIT_WIDTH
          This property indicates the number of pages wide to fit the sheet in.
static java.lang.String PROPERTY_FREEZE_COLUMN
          Indicates the name of the first unlocked column in document's sheets.
static java.lang.String PROPERTY_FREEZE_COLUMN_EDGE
          This property indicates the vertical edge of the freeze pane, relative to the current cell.
static java.lang.String PROPERTY_FREEZE_ROW
          Specifies the index of the first unlocked row in document's sheets.
static java.lang.String PROPERTY_FREEZE_ROW_EDGE
          This property indicates the horizontal edge of the freeze pane, relative to the current cell.
static java.lang.String PROPERTY_IGNORE_ANCHORS
          Flag property that indicates whether local anchors should be ignored when elements are exported to Excel.
static java.lang.String PROPERTY_PAGE_SCALE
          Property used to adjust the page content to a given percent of the normal size in the print preview pane.
static java.lang.String PROPERTY_ROW_OUTLINE_LEVEL_PREFIX
          Property prefix used to indicate the current outline row level, and when necessary, the ending row of the current outline row group with the given level.
static java.lang.String PROPERTY_SHEET_DIRECTION
          This property indicates if the sheet is left-to-right or right-to-left oriented.
static java.lang.String PROPERTY_SHEET_FOOTER_CENTER
          This property stores the text content of the sheet footer's center.
static java.lang.String PROPERTY_SHEET_FOOTER_LEFT
          This property stores the text content of the sheet footer's left side.
static java.lang.String PROPERTY_SHEET_FOOTER_RIGHT
          This property stores the text content of the sheet footer's right side.
static java.lang.String PROPERTY_SHEET_HEADER_CENTER
          This property stores the text content of the sheet header's center.
static java.lang.String PROPERTY_SHEET_HEADER_LEFT
          This property stores the text content of the sheet header's left side.
static java.lang.String PROPERTY_SHEET_HEADER_RIGHT
          This property stores the text content of the sheet header's right side.
static java.lang.String PROPERTY_USE_TIMEZONE
          Property that determines whether date values are to be translated to the timezone that was used to fill the report.
static java.lang.String PROPERTY_WORKBOOK_TEMPLATE
          Property used to store the location of an existing workbook template.
static java.lang.String PROPERTY_WORKBOOK_TEMPLATE_KEEP_SHEETS
          Flag property that specifies whether to keep the sheets of the existing template into generated document.
static java.lang.String PROPERTY_WRAP_TEXT
          This property indicates whether text wrapping is allowed in a given cell.
protected  int reportIndex
           
protected  RunDirectionEnum sheetDirection
           
protected  java.lang.Integer sheetFirstPageNumber
           
protected  java.lang.String sheetFooterCenter
           
protected  java.lang.String sheetFooterLeft
           
protected  java.lang.String sheetFooterRight
           
protected  java.lang.String sheetHeaderCenter
           
protected  java.lang.String sheetHeaderLeft
           
protected  java.lang.String sheetHeaderRight
           
protected  int sheetIndex
          Used for counting the total number of sheets.
protected  java.lang.String[] sheetNames
           
protected  int sheetNamesIndex
          Used for iterating through sheet names.
protected  java.util.Map<java.lang.String,java.lang.Integer> sheetNamesMap
          Used when indexing the identical sheet name.
protected  java.lang.Integer sheetPageScale
           
protected  java.lang.String workbookTemplate
           
protected  boolean wrapText
           
protected static java.lang.String XLS_EXPORTER_PROPERTIES_PREFIX
           
 
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
dateFormatCache, endPageIndex, filter, fontMap, globalOffsetX, globalOffsetY, hyperlinkProducerFactory, isModeBatch, jasperPrint, jasperPrintList, jasperReportsContext, numberFormatCache, parameters, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, startPageIndex
 
Constructor Summary
JRXlsAbstractExporter()
           
JRXlsAbstractExporter(JasperReportsContext jasperReportsContext)
           
 
Method Summary
protected abstract  void addBlankCell(JRExporterGridCell gridCell, int colIndex, int rowIndex)
           
protected abstract  void addOccupiedCell(OccupiedGridCell occupiedGridCell, int colIndex, int rowIndex)
           
protected  int calculateHeightForDinAN(int n)
           
protected  int calculateHeightForDinBN(int n)
           
protected  int calculateHeightForDinCN(int n)
           
protected  int calculateWidthForDinAN(int n)
           
protected  int calculateWidthForDinBN(int n)
           
protected  int calculateWidthForDinCN(int n)
           
protected abstract  void closeWorkbook(java.io.OutputStream os)
           
protected abstract  void createSheet(java.lang.String name)
           
protected abstract  void exportFrame(JRPrintFrame frame, JRExporterGridCell cell, int colIndex, int rowIndex)
           
protected abstract  void exportGenericElement(JRGenericPrintElement element, JRExporterGridCell cell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout)
           
protected abstract  void exportImage(JRPrintImage image, JRExporterGridCell cell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout)
           
protected abstract  void exportLine(JRPrintLine line, JRExporterGridCell cell, int colIndex, int rowIndex)
           
protected  int exportPage(JRPrintPage page, CutsInfo xCuts, int startRow)
           
protected abstract  void exportRectangle(JRPrintGraphicElement element, JRExporterGridCell cell, int colIndex, int rowIndex)
           
 void exportReport()
          Actually starts the export process.
protected  void exportReportToStream(java.io.OutputStream os)
           
protected abstract  void exportText(JRPrintText text, JRExporterGridCell cell, int colIndex, int rowIndex)
           
protected  int getColumnIndex(java.lang.String columnName)
           
protected  java.lang.String getColumnName(int columnIndex)
           
protected  java.lang.String getConvertedPattern(JRPrintText text, java.lang.String pattern)
           
protected  JRFont getDefaultFont()
           
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)
           
 java.lang.String getWorkbookTemplate()
           
protected  boolean isCellHidden(JRPrintElement element)
           
protected  boolean isCellLocked(JRPrintElement element)
           
 boolean isIgnoreAnchors()
           
protected  boolean isValidScale(java.lang.Integer scale)
           
 boolean isWorkbookTemplateKeepSheets()
           
protected  boolean isWrapText(JRPrintElement element)
           
protected  void mergeAndSetRowLevels(XlsRowLevelInfo levelInfo, java.util.SortedMap<java.lang.String,java.lang.Boolean> rowLevelMap, int rowIndex)
           
protected abstract  void openWorkbook(java.io.OutputStream os)
           
protected abstract  void removeColumn(int col)
           
protected  void resetAutoFilters()
           
protected abstract  void setAutoFilter(java.lang.String autoFilterRange)
           
protected abstract  void setBackground()
           
protected abstract  void setCell(JRExporterGridCell gridCell, int colIndex, int rowIndex)
           
protected abstract  void setColumnWidth(int col, int width, boolean autoFit)
           
protected  void setColumnWidths(CutsInfo xCuts)
           
protected  void setExporterHints()
           
protected  void setFreezePane(int rowIndex, int colIndex)
           
protected abstract  void setFreezePane(int rowIndex, int colIndex, boolean isRowEdge, boolean isColumnEdge)
           
 void setIgnoreAnchors(boolean ignoreAnchors)
           
protected  void setParameters()
           
protected abstract  void setRowHeight(int rowIndex, int lastRowHeight, Cut yCut, XlsRowLevelInfo levelInfo)
           
protected abstract  void setRowLevels(XlsRowLevelInfo levelInfo, java.lang.String level)
           
protected  void setScale(CutsInfo xCuts, boolean isToApply)
           
protected abstract  void setScale(java.lang.Integer scale)
           
protected abstract  void setSheetName(java.lang.String sheetName)
           
protected  void setSheetNames()
           
 void setWorkbookTemplate(java.lang.String workbookTemplate)
           
 void setWorkbookTemplateKeepSheets(boolean keepTemplateSheets)
           
protected  java.util.Date translateDateValue(JRPrintText text, java.util.Date value)
           
protected abstract  void updateColumn(int col, boolean autoFit)
           
protected  void updateColumns(CutsInfo xCuts)
           
 
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
createFilter, defaultParseNumber, getBooleanCellValue, getBooleanParameter, getCharacterParameter, getCustomHandler, getDateCellValue, getDateFormat, getExporterKey, getFloatParameter, getHyperlinkProducer, getIntegerParameter, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getParameter, getParameterResolver, getParameters, getPropertiesUtil, getReportContext, getStringArrayParameter, getStringParameter, getStringParameterOrDefault, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setExportContext, setFontMap, setFrameElementsOffset, setHyperlinkProducerFactory, setInput, setJasperPrint, setOffset, setOffset, setOutput, setPageRange, setParameter, setParameters, setReportContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XLS_EXPORTER_PROPERTIES_PREFIX

protected static final java.lang.String XLS_EXPORTER_PROPERTIES_PREFIX
See Also:
Constant Field Values

PROPERTY_CELL_FORMULA

public static final java.lang.String PROPERTY_CELL_FORMULA
Property that stores the formula which has to be applied to a given cell in an excel sheet.

See Also:
Constant Field Values

PROPERTY_CELL_PATTERN

public static final java.lang.String PROPERTY_CELL_PATTERN
Property that stores the pattern which has to be applied to a given cell in an excel sheet.

See Also:
Constant Field Values

PROPERTY_WRAP_TEXT

public static final java.lang.String PROPERTY_WRAP_TEXT
This property indicates whether text wrapping is allowed in a given cell.

The property itself defaults to true.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_FIT_WIDTH

public static final java.lang.String PROPERTY_FIT_WIDTH
This property indicates the number of pages wide to fit the sheet in.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_FIT_HEIGHT

public static final java.lang.String PROPERTY_FIT_HEIGHT
This property indicates the number of pages height to fit the sheet in.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_CELL_LOCKED

public static final java.lang.String PROPERTY_CELL_LOCKED
This property indicates whether the cell is locked.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_CELL_HIDDEN

public static final java.lang.String PROPERTY_CELL_HIDDEN
This property indicates whether the cell content is hidden.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_SHEET_HEADER_LEFT

public static final java.lang.String PROPERTY_SHEET_HEADER_LEFT
This property stores the text content of the sheet header's left side.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_SHEET_HEADER_CENTER

public static final java.lang.String PROPERTY_SHEET_HEADER_CENTER
This property stores the text content of the sheet header's center.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_SHEET_HEADER_RIGHT

public static final java.lang.String PROPERTY_SHEET_HEADER_RIGHT
This property stores the text content of the sheet header's right side.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_SHEET_FOOTER_LEFT

public static final java.lang.String PROPERTY_SHEET_FOOTER_LEFT
This property stores the text content of the sheet footer's left side.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_SHEET_FOOTER_CENTER

public static final java.lang.String PROPERTY_SHEET_FOOTER_CENTER
This property stores the text content of the sheet footer's center.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_SHEET_FOOTER_RIGHT

public static final java.lang.String PROPERTY_SHEET_FOOTER_RIGHT
This property stores the text content of the sheet footer's right side.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_SHEET_DIRECTION

public static final java.lang.String PROPERTY_SHEET_DIRECTION
This property indicates if the sheet is left-to-right or right-to-left oriented. Possible values are: The default value is LTR.

See Also:
JRPropertiesUtil, RunDirectionEnum, Constant Field Values

PROPERTY_FREEZE_ROW

public static final java.lang.String PROPERTY_FREEZE_ROW
Specifies the index of the first unlocked row in document's sheets. All rows above this will be 'frozen'. Allowed values are represented by positive integers in the 1..65536 range. Negative values are not considered. The property should be used when all sheets in the document have the same freeze row index.

See Also:
Constant Field Values

PROPERTY_FREEZE_COLUMN

public static final java.lang.String PROPERTY_FREEZE_COLUMN
Indicates the name of the first unlocked column in document's sheets. All columns to the left of this one will be 'frozen'. Allowed values are letters or letter combinations representing valid column names in Excel, such as A, B, AB, AC, etc. The property should be used when all document sheets have the same freeze column name.

See Also:
Constant Field Values

PROPERTY_FREEZE_ROW_EDGE

public static final java.lang.String PROPERTY_FREEZE_ROW_EDGE
This property indicates the horizontal edge of the freeze pane, relative to the current cell. If set, it overrides the PROPERTY_FREEZE_ROW value. Allowed values are:

See Also:
Constant Field Values

PROPERTY_FREEZE_COLUMN_EDGE

public static final java.lang.String PROPERTY_FREEZE_COLUMN_EDGE
This property indicates the vertical edge of the freeze pane, relative to the current cell. If set, it overrides the PROPERTY_FREEZE_COLUMN and PROPERTY_FREEZE_SHEET_COLUMNS values. Allowed values are:

See Also:
Constant Field Values

PROPERTY_AUTO_FIT_ROW

public static final java.lang.String PROPERTY_AUTO_FIT_ROW
Flag property that indicates whether Excel should autofit the current row height. Allowed values are:

Since:
4.5.1
See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_AUTO_FIT_COLUMN

public static final java.lang.String PROPERTY_AUTO_FIT_COLUMN
Flag property that indicates whether Excel should autofit the current column width. Allowed values are:

Since:
4.5.1
See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_AUTO_FILTER

public static final java.lang.String PROPERTY_AUTO_FILTER
This element-level property is used to indicate the boundaries of the autofilter data range in the current sheet. Allowed values are:

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_COLUMN_WIDTH

public static final java.lang.String PROPERTY_COLUMN_WIDTH
Element-level property used to adjust the column width to values suitable for Excel output, taking into account that column widths are measured in Excel in Normal style default character width units. The pixel-to-character width translation depends on the default normal style character width, so it cannot be always accurately fitted. In this case, one can adjust the current column width by setting this property with an integer value measured in pixels. The JR engine will perform the pixel-to-character width mapping using this value instead of the element's width attribute.
If defined, this property will override the PROPERTY_COLUMN_WIDTH_RATIO value for the current column

See Also:
PROPERTY_COLUMN_WIDTH_RATIO, JRPropertiesUtil, Constant Field Values

PROPERTY_COLUMN_WIDTH_RATIO

public static final java.lang.String PROPERTY_COLUMN_WIDTH_RATIO
Property used to adjust all column widths in a document or sheet with the same width ratio, in order to get column width values suitable for Excel output. Usually column widths are measured by Excel in Normal style default character width units, while the JR engine uses pixels as default size units. When exporting the report to the Excel output format, the pixel-to-character width translation depends on the normal style default character width provided by the Excel instance, so it cannot be always accurately fitted. In this case, one can alter the generated column widths by setting this property with a float value representing the adjustment ratio. The property can be set: Global settings are overriden by report level settings and report level settings are overriden by element level settings. If present, a PROPERTY_COLUMN_WIDTH property will override the PROPERTY_COLUMN_WIDTH_RATIO value for that column only.

See Also:
PROPERTY_COLUMN_WIDTH, JRPropertiesUtil, Constant Field Values

PROPERTY_ROW_OUTLINE_LEVEL_PREFIX

public static final java.lang.String PROPERTY_ROW_OUTLINE_LEVEL_PREFIX
Property prefix used to indicate the current outline row level, and when necessary, the ending row of the current outline row group with the given level. The suffix of these properties is associated with the outline level, while the property value indicates if the current row group should continue or should end. The most recommended practice is to use the outline level itself as property suffix, although this is not mandatory. The suffix may take any other string value, but one has to keep in mind that suffixes are used as sorted row level descriptors. For instance, because "aaa" < "bbb", the outline level associated with the "aaa" suffix will be smaller than the level associated with the "bbb" suffix. The most intuitive representation of the row levels uses the row level as property suffix.
In such a case, The net.sf.jasperreports.export.xls.outline.level.2 property means that its value is correlated with the outline level 2, so the current row belongs to a level 2 row group. Based on Office Open XML specs, allowed values for outline levels are positive integers from 1 to 7.
The value of this property could be any expression (including null). When such a property occurrence is met, the suffix indicates the outline level for that row. If multiple properties with the same prefix are defined for the same row, the deepest outline level is considered for that row. To end an outline row group one has to set the related outline level property with the End value. This is a special property value instructing the JR engine that the current row group of that level ends on the current row.

See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_USE_TIMEZONE

public static final java.lang.String PROPERTY_USE_TIMEZONE
Property that determines whether date values are to be translated to the timezone that was used to fill the report.

By default, date values are exported to Excel using the default timezone of the system. Setting this property to true instructs the exporter to use he report fill timezone to export date values.

The property only has effect when JRXlsAbstractExporterParameter.IS_DETECT_CELL_TYPE is set.

The property can be set globally, at report level and at element level. The default value is false.

Since:
4.5.0
See Also:
Constant Field Values

PROPERTY_WORKBOOK_TEMPLATE

public static final java.lang.String PROPERTY_WORKBOOK_TEMPLATE
Property used to store the location of an existing workbook template. The content of an existing workbook document or template can be embedded into exported document if the template location is known. In this case the content of the template will be exported first and the content of the exported report will be appended to this one. Macros and other settings in the existing template will be also preserved in the generated document. Templates can be loaded from Excel template files (*.xlt) as well as from valid Excel documents (*.xls).

This property is used in Excel exporters based either on Apache POI APIs (JRXlsExporter) or on JExcelApi library (JExcelApiExporter). There's no similar property for the JRXlsxExporter.

Since:
4.5.1
See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_WORKBOOK_TEMPLATE_KEEP_SHEETS

public static final java.lang.String PROPERTY_WORKBOOK_TEMPLATE_KEEP_SHEETS
Flag property that specifies whether to keep the sheets of the existing template into generated document. Sometimes is important to embed in a generated document only macros and/or other global settings from an existing template, but without keeping the own sheets of the template document. If set to false, this property prevent the template sheets to be exported.

This property is used in conjunction with PROPERTY_WORKBOOK_TEMPLATE.

Allowed values are:

Since:
4.5.1
See Also:
JRPropertiesUtil, Constant Field Values

PROPERTY_IGNORE_ANCHORS

public static final java.lang.String PROPERTY_IGNORE_ANCHORS
Flag property that indicates whether local anchors should be ignored when elements are exported to Excel. The default value is false.

Property scope:

See Also:
Constant Field Values

PROPERTY_PAGE_SCALE

public static final java.lang.String PROPERTY_PAGE_SCALE
Property used to adjust the page content to a given percent of the normal size in the print preview pane. Allowed values are positive integers from 10 to 400, representing percents of the normal size.
Property scope: Global settings are overriden by report level settings; report level settings are overriden by element (sheet) level settings.
The property overrides the PROPERTY_FIT_WIDTH and PROPERTY_FIT_HEIGHT values.

See Also:
PROPERTY_FIT_WIDTH, PROPERTY_FIT_HEIGHT, JRPropertiesUtil, Constant Field Values

PROPERTY_FIRST_PAGE_NUMBER

public static final java.lang.String PROPERTY_FIRST_PAGE_NUMBER
Property that specifies the first page number in the page setup dialog.
Property scope: Global settings are overriden by report level settings; report level settings are overriden by element (sheet) level settings.

See Also:
JRPropertiesUtil, Constant Field Values

loadedFonts

protected java.util.List<java.lang.Object> loadedFonts

isOnePagePerSheet

protected boolean isOnePagePerSheet

isRemoveEmptySpaceBetweenRows

protected boolean isRemoveEmptySpaceBetweenRows

isRemoveEmptySpaceBetweenColumns

protected boolean isRemoveEmptySpaceBetweenColumns

isWhitePageBackground

protected boolean isWhitePageBackground

isDetectCellType

protected boolean isDetectCellType

isFontSizeFixEnabled

protected boolean isFontSizeFixEnabled

isImageBorderFixEnabled

protected boolean isImageBorderFixEnabled

isIgnoreGraphics

protected boolean isIgnoreGraphics

createCustomPalette

protected boolean createCustomPalette

isCollapseRowSpan

protected boolean isCollapseRowSpan

isIgnoreCellBorder

protected boolean isIgnoreCellBorder

isIgnoreCellBackground

protected boolean isIgnoreCellBackground

wrapText

protected boolean wrapText

cellLocked

protected boolean cellLocked

cellHidden

protected boolean cellHidden

maxRowsPerSheet

protected int maxRowsPerSheet

sheetNames

protected java.lang.String[] sheetNames

sheetHeaderLeft

protected java.lang.String sheetHeaderLeft

sheetHeaderCenter

protected java.lang.String sheetHeaderCenter

sheetHeaderRight

protected java.lang.String sheetHeaderRight

sheetFooterLeft

protected java.lang.String sheetFooterLeft

sheetFooterCenter

protected java.lang.String sheetFooterCenter

sheetFooterRight

protected java.lang.String sheetFooterRight

sheetDirection

protected RunDirectionEnum sheetDirection

formatPatternsMap

protected java.util.Map<java.lang.String,java.lang.String> formatPatternsMap

progressMonitor

protected JRExportProgressMonitor progressMonitor

reportIndex

protected int reportIndex

pageIndex

protected int pageIndex

defaultFont

protected JRFont defaultFont

sheetIndex

protected int sheetIndex
Used for counting the total number of sheets.


sheetNamesIndex

protected int sheetNamesIndex
Used for iterating through sheet names.


sheetNamesMap

protected java.util.Map<java.lang.String,java.lang.Integer> sheetNamesMap
Used when indexing the identical sheet name. Contains sheet names as keys and the number of occurrences of each sheet name as values.


isIgnorePageMargins

protected boolean isIgnorePageMargins

gridRowFreezeIndex

protected int gridRowFreezeIndex

gridColumnFreezeIndex

protected int gridColumnFreezeIndex

maxRowFreezeIndex

protected int maxRowFreezeIndex

maxColumnFreezeIndex

protected int maxColumnFreezeIndex

isFreezeRowEdge

protected boolean isFreezeRowEdge

isFreezeColumnEdge

protected boolean isFreezeColumnEdge

autoFilterStart

protected java.lang.String autoFilterStart

autoFilterEnd

protected java.lang.String autoFilterEnd

columnWidthRatio

protected java.lang.Float columnWidthRatio

documentPageScale

protected java.lang.Integer documentPageScale

sheetPageScale

protected java.lang.Integer sheetPageScale

documentFirstPageNumber

protected java.lang.Integer documentFirstPageNumber

sheetFirstPageNumber

protected java.lang.Integer sheetFirstPageNumber

firstPageNotSet

protected boolean firstPageNotSet

keepTemplateSheets

protected java.lang.Boolean keepTemplateSheets

workbookTemplate

protected java.lang.String workbookTemplate

ignoreAnchors

protected boolean ignoreAnchors
Constructor Detail

JRXlsAbstractExporter

public JRXlsAbstractExporter()
See Also:
JRXlsAbstractExporter(JasperReportsContext)

JRXlsAbstractExporter

public JRXlsAbstractExporter(JasperReportsContext jasperReportsContext)
Method Detail

getDefaultFont

protected JRFont getDefaultFont()

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

setParameters

protected void setParameters()

setExporterHints

protected void setExporterHints()

setBackground

protected abstract void setBackground()

exportReportToStream

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

exportPage

protected int exportPage(JRPrintPage page,
                         CutsInfo xCuts,
                         int startRow)
                  throws JRException
Returns:
the number of rows added.
Throws:
JRException

mergeAndSetRowLevels

protected void mergeAndSetRowLevels(XlsRowLevelInfo levelInfo,
                                    java.util.SortedMap<java.lang.String,java.lang.Boolean> rowLevelMap,
                                    int rowIndex)

setColumnWidths

protected void setColumnWidths(CutsInfo xCuts)

setScale

protected void setScale(CutsInfo xCuts,
                        boolean isToApply)

updateColumns

protected void updateColumns(CutsInfo xCuts)

getStyledText

protected JRStyledText getStyledText(JRPrintText textElement)
Overrides:
getStyledText in class JRAbstractExporter

getTextAlignHolder

protected static JRXlsAbstractExporter.TextAlignHolder getTextAlignHolder(JRPrintText textElement)

getImageBorderCorrection

protected int getImageBorderCorrection(JRPen pen)

calculateWidthForDinAN

protected final int calculateWidthForDinAN(int n)

calculateHeightForDinAN

protected final int calculateHeightForDinAN(int n)

calculateWidthForDinBN

protected final int calculateWidthForDinBN(int n)

calculateHeightForDinBN

protected final int calculateHeightForDinBN(int n)

calculateWidthForDinCN

protected final int calculateWidthForDinCN(int n)

calculateHeightForDinCN

protected final int calculateHeightForDinCN(int n)

isWrapText

protected boolean isWrapText(JRPrintElement element)

isCellLocked

protected boolean isCellLocked(JRPrintElement element)

getFormula

protected java.lang.String getFormula(JRPrintText text)

setSheetNames

protected void setSheetNames()

isCellHidden

protected boolean isCellHidden(JRPrintElement element)

getConvertedPattern

protected java.lang.String getConvertedPattern(JRPrintText text,
                                               java.lang.String pattern)

getColumnIndex

protected int getColumnIndex(java.lang.String columnName)
Returns:
the calculated column index

getColumnName

protected java.lang.String getColumnName(int columnIndex)
Returns:
the calculated column name

setFreezePane

protected void setFreezePane(int rowIndex,
                             int colIndex)

resetAutoFilters

protected void resetAutoFilters()

translateDateValue

protected java.util.Date translateDateValue(JRPrintText text,
                                            java.util.Date value)

isValidScale

protected boolean isValidScale(java.lang.Integer scale)

isWorkbookTemplateKeepSheets

public boolean isWorkbookTemplateKeepSheets()

setWorkbookTemplateKeepSheets

public void setWorkbookTemplateKeepSheets(boolean keepTemplateSheets)

getWorkbookTemplate

public java.lang.String getWorkbookTemplate()

setWorkbookTemplate

public void setWorkbookTemplate(java.lang.String workbookTemplate)

isIgnoreAnchors

public boolean isIgnoreAnchors()

setIgnoreAnchors

public void setIgnoreAnchors(boolean ignoreAnchors)

getNature

protected abstract ExporterNature getNature()

openWorkbook

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

createSheet

protected abstract void createSheet(java.lang.String name)

closeWorkbook

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

setColumnWidth

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

removeColumn

protected abstract void removeColumn(int col)

updateColumn

protected abstract void updateColumn(int col,
                                     boolean autoFit)

setRowHeight

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

setCell

protected abstract void setCell(JRExporterGridCell gridCell,
                                int colIndex,
                                int rowIndex)

addBlankCell

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

addOccupiedCell

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

exportText

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

exportImage

protected abstract void exportImage(JRPrintImage image,
                                    JRExporterGridCell cell,
                                    int colIndex,
                                    int rowIndex,
                                    int emptyCols,
                                    int yCutsRow,
                                    JRGridLayout layout)
                             throws JRException
Throws:
JRException

exportRectangle

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

exportLine

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

exportFrame

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

exportGenericElement

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

setFreezePane

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

setSheetName

protected abstract void setSheetName(java.lang.String sheetName)

setAutoFilter

protected abstract void setAutoFilter(java.lang.String autoFilterRange)

setRowLevels

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

setScale

protected abstract void setScale(java.lang.Integer scale)


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com