Class ExcelAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,E extends JRExporterContext>
- java.lang.Object
-
- net.sf.jasperreports.engine.JRAbstractExporter<RC,C,OutputStreamExporterOutput,E>
-
- net.sf.jasperreports.engine.export.ExcelAbstractExporter<RC,C,E>
-
- All Implemented Interfaces:
JRExporter<ExporterInput,RC,C,OutputStreamExporterOutput>,Exporter<ExporterInput,RC,C,OutputStreamExporterOutput>
- Direct Known Subclasses:
JRXlsAbstractExporter,XlsxMetadataExporter
public abstract class ExcelAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,E extends JRExporterContext> extends JRAbstractExporter<RC,C,OutputStreamExporterOutput,E>
- Author:
- Sanda Zaharia (shertage@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classExcelAbstractExporter.NameScopeprotected static classExcelAbstractExporter.TextAlignHolder-
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
-
-
Field Summary
Fields Modifier and Type Field Description protected StringautoFilterEndprotected StringautoFilterStartprotected booleancollapseRowSpanstatic StringCURRENT_ROW_AUTOFITstatic StringCURRENT_ROW_HEIGHTstatic StringDEFAULT_DEFINED_NAME_SCOPEstatic StringDEFAULT_DEFINED_NAME_SCOPE_SEPARATORstatic StringDEFAULT_SHEET_NAME_PREFIXprotected booleandefaultCellHiddenprotected booleandefaultCellLockedprotected JRFontdefaultFontprotected booleandefaultIgnoreHyperlinkprotected booleandefaultIgnoreTextFormattingprotected ImageAnchorTypeEnumdefaultImageAnchorTypeprotected booleandefaultShrinkToFitprotected booleandefaultUseTimeZoneprotected booleandefaultWrapTextprotected Map<ExcelAbstractExporter.NameScope,String>definedNamesMapprotected booleandetectCellTypestatic StringEXCEPTION_MESSAGE_KEY_CANNOT_ADD_CELLstatic StringEXCEPTION_MESSAGE_KEY_CANNOT_MERGE_CELLSstatic StringEXCEPTION_MESSAGE_KEY_CELL_FORMAT_TEMPLATE_ERRORstatic StringEXCEPTION_MESSAGE_KEY_COLUMN_INDEX_BEYOND_LIMITstatic StringEXCEPTION_MESSAGE_KEY_LOADED_FONTS_ERRORstatic StringEXCEPTION_MESSAGE_KEY_NEGATIVE_COLUMN_INDEXstatic StringEXCEPTION_MESSAGE_KEY_REPORT_GENERATION_ERRORstatic StringEXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUNDprotected booleanfirstPageNotSetprotected Map<String,String>formatPatternsMapprotected booleanignoreAnchorsprotected booleanimageBorderFixEnabledprotected StringinvalidCharReplacementprotected BooleankeepTemplateSheetsprotected List<Object>loadedFontsprotected intmaxColumnIndexprotected ExporterNaturenatureprotected booleanonePagePerSheetprotected Map<Integer,Boolean>onePagePerSheetMapprotected PrintPageFormatpageFormatprotected intpageIndexstatic StringPROPERTY_AUTO_FILTERThis element-level property is used to indicate the boundaries of the autofilter data range in the current sheet.static StringPROPERTY_AUTO_FIT_COLUMNFlag property that indicates whether Excel should autofit the current column width.static StringPROPERTY_AUTO_FIT_ROWFlag property that indicates whether Excel should autofit the current row height.static StringPROPERTY_BREAK_AFTER_ROWElement level property specifying if a sheet will break after the row displaying that element.static StringPROPERTY_BREAK_BEFORE_ROWElement level property specifying if a sheet will break before the row displaying that element.static StringPROPERTY_CELL_FORMULAProperty that stores the formula which has to be applied to a given cell in an excel sheet.static StringPROPERTY_CELL_PATTERNProperty that stores the pattern which has to be applied to a given cell in an excel sheet.static StringPROPERTY_COLUMN_NAMEA string that represents the name for the column that should appear in the XLS export.static StringPROPERTY_COLUMN_WIDTHElement-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 StringPROPERTY_COLUMN_WIDTH_METADATAElement-level property used to adjust the column width to values suitable for Excel metadata output, taking into account that when column headers are included in the report, they come with no available width settings.static StringPROPERTY_DATAProperty that specifies what value to associate withPROPERTY_COLUMN_NAME.static StringPROPERTY_FREEZE_COLUMN_EDGEThis property indicates the vertical edge of the freeze pane, relative to the current cell.static StringPROPERTY_FREEZE_ROW_EDGEThis property indicates the horizontal edge of the freeze pane, relative to the current cell.static StringPROPERTY_IGNORE_ROW_HEIGHTFlag property that indicates whether the height of the element should contribute to the current row height calculation.static StringPROPERTY_REPEAT_VALUEProperty that specifies whether the value associated withPROPERTY_COLUMN_NAMEshould be repeated or not when it is missing.static StringPROPERTY_ROW_OUTLINE_LEVEL_PREFIXProperty 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 StringPROPERTY_SHEET_NAMEProperty used to set the name of the sheet containing a given element.protected RenderersCacherenderersCacheprotected intreportIndexprotected intsheetIndexUsed for counting the total number of sheets.protected JRXlsAbstractExporter.SheetInfosheetInfoprotected String[]sheetNamesprotected intsheetNamesIndexUsed for iterating through sheet names.protected Map<String,Integer>sheetNamesMapUsed when indexing the identical sheet name.protected intsheetsBeforeCurrentReportprotected Map<Integer,Integer>sheetsBeforeCurrentReportMapprotected StringworkbookTemplatestatic StringXLS_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_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_MIXED_CALLS_NOT_ALLOWED, EXCEPTION_MESSAGE_KEY_OUTPUT_WRITER_ERROR, EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE, exporterConfiguration, exporterContext, exporterInput, exporterOutput, filter, fontUtil, hyperlinkProducerFactory, itemConfiguration, jasperPrint, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, rendererUtil, styledTextUtil, textValueClasses
-
-
Constructor Summary
Constructors Constructor Description ExcelAbstractExporter()ExcelAbstractExporter(JasperReportsContext jasperReportsContext)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract voidaddRowBreak(int rowIndex)protected intcalculateHeightForDinAN(int n)protected intcalculateHeightForDinBN(int n)protected intcalculateHeightForDinCN(int n)protected intcalculateWidthForDinAN(int n)protected intcalculateWidthForDinBN(int n)protected intcalculateWidthForDinCN(int n)protected abstract voidcloseSheet()protected abstract voidcloseWorkbook(OutputStream os)protected voidconfigureDefinedNames(ExporterNature exporterNature, JRPrintElement element)protected voidconfigureDefinedNames(JRPropertiesUtil.PropertySuffix propertySuffix)protected voidconfigureDefinedNames(JRPropertiesUtil.PropertySuffix[] names)protected voidensureInput()protected voidensureOutput()protected abstract voidexportEmptyReport()voidexportReport()Performs the export.protected abstract voidexportReportToStream(OutputStream os)static StringgetColumIndexName(int colIndex, int maxColIndex)protected intgetColumnIndex(String columnName)protected StringgetColumnName(int columnIndex)Deprecated.Replaced byJRStringUtil.getLetterNumeral(int, boolean).protected StringgetConvertedPattern(JRPrintText text, String pattern)protected JRFontgetDefaultFont()protected StringgetFormula(JRPrintText text)protected intgetImageBorderCorrection(JRPen pen)protected IntegergetMaxRowsPerSheet()protected ExporterNaturegetNature()protected StringgetSheetName(String sheetName)protected StringgetSheetName(String sheetName, String defaultSheetName)protected JRStyledTextgetStyledText(JRPrintText textElement)static ExcelAbstractExporter.TextAlignHoldergetTextAlignHolder(JRPrintText textElement)protected booleanhasGlobalSheetNames()protected voidinitExport()protected voidinitReport()protected booleanisCellHidden(JRPrintElement element)protected booleanisCellLocked(JRPrintElement element)protected booleanisIgnoreTextFormatting(JRPrintElement element)protected booleanisShrinkToFit(JRPrintElement element)protected booleanisUseTimeZone(JRPrintElement element)protected booleanisValidScale(Integer scale)protected booleanisWrapText(JRPrintElement element)protected voidmergeAndSetRowLevels(XlsRowLevelInfo levelInfo, SortedMap<String,Boolean> rowLevelMap, int rowIndex)protected abstract voidopenWorkbook(OutputStream os)protected voidresetAutoFilters()protected abstract voidsetAutoFilter(String autoFilterRange)protected abstract voidsetColumnWidth(int col, int width, boolean autoFit)protected abstract voidsetFreezePane(int rowIndex, int colIndex)protected abstract voidsetRowLevels(XlsRowLevelInfo levelInfo, String level)protected abstract voidsetSheetName(String sheetName)protected voidsetSheetNames()protected StringtoExcelName(String name)protected DatetranslateDateValue(JRPrintText text, Date value)protected voidupdateHeaderFooter(JRXlsAbstractExporter.SheetInfo.SheetPrintSettings printSettings, XlsReportConfiguration configuration)protected voidupdatePrintSettings(JRXlsAbstractExporter.SheetInfo.SheetPrintSettings printSettings, XlsReportConfiguration configuration)-
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureJasperReportsContext, getBooleanCellValue, getConfigurationInterface, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterContext, getExporterInput, getExporterKey, getExporterOutput, getExporterPropertiesPrefix, getHyperlinkProducer, getItemConfigurationInterface, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getParameter, getParameters, getPropertiesUtil, getRendererUtil, getReportContext, getRepository, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperReportsContext, setOffset, setOffset, setParameter, setParameters, setReportContext
-
-
-
-
Field Detail
-
XLS_EXPORTER_PROPERTIES_PREFIX
public static final String XLS_EXPORTER_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_SHEET_NAME_PREFIX
public static final String DEFAULT_SHEET_NAME_PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_DEFINED_NAME_SCOPE
public static final String DEFAULT_DEFINED_NAME_SCOPE
- See Also:
- Constant Field Values
-
DEFAULT_DEFINED_NAME_SCOPE_SEPARATOR
public static final String DEFAULT_DEFINED_NAME_SCOPE_SEPARATOR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_CANNOT_ADD_CELL
public static final String EXCEPTION_MESSAGE_KEY_CANNOT_ADD_CELL
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_CANNOT_MERGE_CELLS
public static final String EXCEPTION_MESSAGE_KEY_CANNOT_MERGE_CELLS
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_CELL_FORMAT_TEMPLATE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_CELL_FORMAT_TEMPLATE_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_COLUMN_INDEX_BEYOND_LIMIT
public static final String EXCEPTION_MESSAGE_KEY_COLUMN_INDEX_BEYOND_LIMIT
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_LOADED_FONTS_ERROR
public static final String EXCEPTION_MESSAGE_KEY_LOADED_FONTS_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_NEGATIVE_COLUMN_INDEX
public static final String EXCEPTION_MESSAGE_KEY_NEGATIVE_COLUMN_INDEX
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_REPORT_GENERATION_ERROR
public static final String EXCEPTION_MESSAGE_KEY_REPORT_GENERATION_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUND
- See Also:
- Constant Field Values
-
PROPERTY_CELL_FORMULA
public static final 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 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_SHEET_NAME
public static final String PROPERTY_SHEET_NAME
Property used to set the name of the sheet containing a given element. Its value overrides the report-level settings for the sheet name. If several elements in the sheet contain this property, the engine will consider the value of the last exported element's property.- See Also:
JRPropertiesUtil, Constant Field Values
-
PROPERTY_FREEZE_ROW_EDGE
public static final 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:Top- The current row is the first unlocked row in the sheet. All rows above are 'frozen'.Bottom- The current row is the last 'frozen' row in the sheet. All rows below are unlocked.
- See Also:
- Constant Field Values
-
PROPERTY_FREEZE_COLUMN_EDGE
public static final 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:Left- The current column is the first unlocked column in the sheet. All columns to the left are 'frozen'.Right- The current column is the last 'frozen' column in the sheet. All columns to the right are unlocked.
- See Also:
- Constant Field Values
-
PROPERTY_AUTO_FIT_ROW
public static final String PROPERTY_AUTO_FIT_ROW
Flag property that indicates whether Excel should autofit the current row height. Allowed values are:truefalse- this is the default value.
- Since:
- 4.5.1
- See Also:
JRPropertiesUtil, Constant Field Values
-
PROPERTY_IGNORE_ROW_HEIGHT
public static final String PROPERTY_IGNORE_ROW_HEIGHT
Flag property that indicates whether the height of the element should contribute to the current row height calculation. The current row height is given by the tallest element on the row, unless row height auto fit is activated. But in certain cases, the tallest element might span multiple rows and thus its bigger height should not be considered, especially in case of metadata based exports. Allowed values are:truefalse- this is the default value.
- Since:
- 6.20.1
- See Also:
JRPropertiesUtil, Constant Field Values
-
PROPERTY_AUTO_FIT_COLUMN
public static final String PROPERTY_AUTO_FIT_COLUMN
Flag property that indicates whether Excel should autofit the current column width. Allowed values are:truefalse- this is the default value.
- Since:
- 4.5.1
- See Also:
JRPropertiesUtil, Constant Field Values
-
PROPERTY_AUTO_FILTER
public static final 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:Start- The current cell will be marked as autofilter heading cell, and column data below/to the right of this cell can be considered as part of the autofilter data range. The starting point of the autofilter data range will be the next cell below the current cell (ie if the current cell reference is B4, the autofilter range will start with the "B5" cell reference: "B5:M20").
If multiple autofilterStartvalues are found in the same sheet, only the last one will be considered. If theStartvalue is present but noEndvalue is found in the sheet, then only the current column will be considered for the data range.
If the autofilterStartvalue is set on the same row as the autofilterEndvalue, the data range will include all data below this heading row, placed between the start column and the end column.End- The current cell will be marked as autofilter ending cell, and column data in this cell and above/to the left can be considered as part of the autofilter data range. The ending cell in the data range is the current cell reference (ie if the current cell reference is M20, the autofilter range will end in "M20": "B5:M20"). The heading cell for the current column will be placed in the same column on the row containing the autofilterStartvalue.
Caution: If no autofilterStartvalue is found in the sheet, the autofilterEndvalue will be considered asStartvalue instead.
If multiple autofilterEndvalue are found in the same sheet, only the last one will be considered.
If the autofilterStartvalue is set on the same row as the autofilterEndvalue, the data range will include all data below this heading row, placed between the start column and the end column.
- See Also:
JRPropertiesUtil, Constant Field Values
-
PROPERTY_COLUMN_WIDTH
public static final 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'swidthattribute.
If defined, this property will override thePROPERTY_COLUMN_WIDTH_RATIOvalue for the current column
-
PROPERTY_ROW_OUTLINE_LEVEL_PREFIX
public static final 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, thenet.sf.jasperreports.export.xls.outline.level.2property 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 (includingnull). 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 theEndvalue. 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_BREAK_BEFORE_ROW
public static final String PROPERTY_BREAK_BEFORE_ROW
Element level property specifying if a sheet will break before the row displaying that element. It is very useful especially when displaying each report's group on a separate sheet is intended.- See Also:
- Constant Field Values
-
PROPERTY_BREAK_AFTER_ROW
public static final String PROPERTY_BREAK_AFTER_ROW
Element level property specifying if a sheet will break after the row displaying that element. It is very useful especially when displaying each report's group on a separate sheet is intended.- See Also:
- Constant Field Values
-
PROPERTY_COLUMN_NAME
public static final 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 inXlsMetadataReportConfiguration.getColumnNames(), if provided.- See Also:
JRPropertiesUtil, Constant Field Values
-
PROPERTY_REPEAT_VALUE
public static final String PROPERTY_REPEAT_VALUE
Property that specifies whether the value associated withPROPERTY_COLUMN_NAMEshould 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 String PROPERTY_DATA
Property that specifies what value to associate withPROPERTY_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
-
PROPERTY_COLUMN_WIDTH_METADATA
public static final String PROPERTY_COLUMN_WIDTH_METADATA
Element-level property used to adjust the column width to values suitable for Excel metadata output, taking into account that when column headers are included in the report, they come with no available width settings. Also keep in mind 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'swidthattribute.
If defined, this property will override both thePROPERTY_COLUMN_WIDTHvalue for the current column and the the element'swidthattribute
-
CURRENT_ROW_HEIGHT
public static final String CURRENT_ROW_HEIGHT
- See Also:
- Constant Field Values
-
CURRENT_ROW_AUTOFIT
public static final String CURRENT_ROW_AUTOFIT
- See Also:
- Constant Field Values
-
nature
protected ExporterNature nature
-
sheetNames
protected String[] sheetNames
-
reportIndex
protected int reportIndex
-
pageIndex
protected int pageIndex
-
pageFormat
protected PrintPageFormat pageFormat
-
sheetsBeforeCurrentReport
protected int sheetsBeforeCurrentReport
-
renderersCache
protected RenderersCache renderersCache
-
defaultFont
protected JRFont defaultFont
-
sheetInfo
protected JRXlsAbstractExporter.SheetInfo sheetInfo
-
sheetIndex
protected int sheetIndex
Used for counting the total number of sheets.
-
sheetNamesIndex
protected int sheetNamesIndex
Used for iterating through sheet names.
-
sheetNamesMap
protected Map<String,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.
-
autoFilterStart
protected String autoFilterStart
-
autoFilterEnd
protected String autoFilterEnd
-
firstPageNotSet
protected boolean firstPageNotSet
-
keepTemplateSheets
protected Boolean keepTemplateSheets
-
workbookTemplate
protected String workbookTemplate
-
invalidCharReplacement
protected String invalidCharReplacement
-
maxColumnIndex
protected int maxColumnIndex
-
definedNamesMap
protected Map<ExcelAbstractExporter.NameScope,String> definedNamesMap
-
onePagePerSheet
protected boolean onePagePerSheet
-
defaultShrinkToFit
protected boolean defaultShrinkToFit
-
defaultWrapText
protected boolean defaultWrapText
-
defaultCellLocked
protected boolean defaultCellLocked
-
defaultCellHidden
protected boolean defaultCellHidden
-
defaultIgnoreTextFormatting
protected boolean defaultIgnoreTextFormatting
-
ignoreAnchors
protected boolean ignoreAnchors
-
defaultIgnoreHyperlink
protected boolean defaultIgnoreHyperlink
-
detectCellType
protected boolean detectCellType
-
defaultImageAnchorType
protected ImageAnchorTypeEnum defaultImageAnchorType
-
collapseRowSpan
protected boolean collapseRowSpan
-
defaultUseTimeZone
protected boolean defaultUseTimeZone
-
imageBorderFixEnabled
protected boolean imageBorderFixEnabled
-
-
Constructor Detail
-
ExcelAbstractExporter
public ExcelAbstractExporter()
-
ExcelAbstractExporter
public ExcelAbstractExporter(JasperReportsContext jasperReportsContext)
-
-
Method Detail
-
getDefaultFont
protected JRFont getDefaultFont()
-
exportReport
public void exportReport() throws JRExceptionDescription copied from interface:ExporterPerforms the export.- Specified by:
exportReportin interfaceExporter<ExporterInput,RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput>- Specified by:
exportReportin classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>- Throws:
JRException
-
ensureInput
protected void ensureInput()
- Overrides:
ensureInputin classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>
-
ensureOutput
protected void ensureOutput()
- Specified by:
ensureOutputin classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>
-
initExport
protected void initExport()
- Overrides:
initExportin classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>
-
initReport
protected void initReport()
- Overrides:
initReportin classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>
-
updatePrintSettings
protected void updatePrintSettings(JRXlsAbstractExporter.SheetInfo.SheetPrintSettings printSettings, XlsReportConfiguration configuration)
-
updateHeaderFooter
protected void updateHeaderFooter(JRXlsAbstractExporter.SheetInfo.SheetPrintSettings printSettings, XlsReportConfiguration configuration)
-
mergeAndSetRowLevels
protected void mergeAndSetRowLevels(XlsRowLevelInfo levelInfo, SortedMap<String,Boolean> rowLevelMap, int rowIndex)
-
getStyledText
protected JRStyledText getStyledText(JRPrintText textElement)
- Overrides:
getStyledTextin classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>
-
getTextAlignHolder
public static ExcelAbstractExporter.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)
-
isShrinkToFit
protected boolean isShrinkToFit(JRPrintElement element)
-
isIgnoreTextFormatting
protected boolean isIgnoreTextFormatting(JRPrintElement element)
-
getFormula
protected String getFormula(JRPrintText text)
-
setSheetNames
protected void setSheetNames()
-
hasGlobalSheetNames
protected boolean hasGlobalSheetNames()
-
isCellHidden
protected boolean isCellHidden(JRPrintElement element)
-
getConvertedPattern
protected String getConvertedPattern(JRPrintText text, String pattern)
-
getColumnIndex
protected int getColumnIndex(String columnName)
- Returns:
- the calculated column index
-
getColumnName
protected String getColumnName(int columnIndex)
Deprecated.Replaced byJRStringUtil.getLetterNumeral(int, boolean).
-
resetAutoFilters
protected void resetAutoFilters()
-
isUseTimeZone
protected boolean isUseTimeZone(JRPrintElement element)
-
translateDateValue
protected Date translateDateValue(JRPrintText text, Date value)
-
isValidScale
protected boolean isValidScale(Integer scale)
-
getMaxRowsPerSheet
protected Integer getMaxRowsPerSheet()
-
getNature
protected ExporterNature getNature()
-
getColumIndexName
public static String getColumIndexName(int colIndex, int maxColIndex)
- Parameters:
colIndex- The 0-based integer column index- Returns:
- The column name computed from the 0-based column index
-
configureDefinedNames
protected void configureDefinedNames(ExporterNature exporterNature, JRPrintElement element)
-
configureDefinedNames
protected void configureDefinedNames(JRPropertiesUtil.PropertySuffix[] names)
-
configureDefinedNames
protected void configureDefinedNames(JRPropertiesUtil.PropertySuffix propertySuffix)
-
openWorkbook
protected abstract void openWorkbook(OutputStream os) throws JRException, IOException
- Throws:
JRExceptionIOException
-
closeSheet
protected abstract void closeSheet()
-
closeWorkbook
protected abstract void closeWorkbook(OutputStream os) throws JRException, IOException
- Throws:
JRExceptionIOException
-
setColumnWidth
protected abstract void setColumnWidth(int col, int width, boolean autoFit)
-
addRowBreak
protected abstract void addRowBreak(int rowIndex)
-
setFreezePane
protected abstract void setFreezePane(int rowIndex, int colIndex)
-
setSheetName
protected abstract void setSheetName(String sheetName)
-
setAutoFilter
protected abstract void setAutoFilter(String autoFilterRange)
-
setRowLevels
protected abstract void setRowLevels(XlsRowLevelInfo levelInfo, String level)
-
exportReportToStream
protected abstract void exportReportToStream(OutputStream os) throws JRException, IOException
- Throws:
JRExceptionIOException
-
exportEmptyReport
protected abstract void exportEmptyReport() throws JRException, IOException- Throws:
JRExceptionIOException
-
-