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:
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 class
ExcelAbstractExporter.NameScope
protected static class
ExcelAbstractExporter.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 String
autoFilterEnd
protected String
autoFilterStart
protected boolean
collapseRowSpan
static String
CURRENT_ROW_AUTOFIT
static String
CURRENT_ROW_HEIGHT
static String
DEFAULT_DEFINED_NAME_SCOPE
static String
DEFAULT_DEFINED_NAME_SCOPE_SEPARATOR
static String
DEFAULT_SHEET_NAME_PREFIX
protected boolean
defaultCellHidden
protected boolean
defaultCellLocked
protected JRFont
defaultFont
protected boolean
defaultIgnoreHyperlink
protected boolean
defaultIgnoreTextFormatting
protected ImageAnchorTypeEnum
defaultImageAnchorType
protected boolean
defaultShrinkToFit
protected boolean
defaultUseTimeZone
protected boolean
defaultWrapText
protected Map<ExcelAbstractExporter.NameScope,String>
definedNamesMap
protected boolean
detectCellType
static String
EXCEPTION_MESSAGE_KEY_CANNOT_ADD_CELL
static String
EXCEPTION_MESSAGE_KEY_CANNOT_MERGE_CELLS
static String
EXCEPTION_MESSAGE_KEY_CELL_FORMAT_TEMPLATE_ERROR
static String
EXCEPTION_MESSAGE_KEY_COLUMN_INDEX_BEYOND_LIMIT
static String
EXCEPTION_MESSAGE_KEY_LOADED_FONTS_ERROR
static String
EXCEPTION_MESSAGE_KEY_NEGATIVE_COLUMN_INDEX
static String
EXCEPTION_MESSAGE_KEY_REPORT_GENERATION_ERROR
static String
EXCEPTION_MESSAGE_KEY_TEMPLATE_NOT_FOUND
protected boolean
firstPageNotSet
protected Map<String,String>
formatPatternsMap
protected boolean
ignoreAnchors
protected boolean
imageBorderFixEnabled
protected String
invalidCharReplacement
protected Boolean
keepTemplateSheets
protected List<Object>
loadedFonts
protected int
maxColumnIndex
protected ExporterNature
nature
protected boolean
onePagePerSheet
protected Map<Integer,Boolean>
onePagePerSheetMap
protected PrintPageFormat
pageFormat
protected int
pageIndex
static String
PROPERTY_AUTO_FILTER
This element-level property is used to indicate the boundaries of the autofilter data range in the current sheet.static String
PROPERTY_AUTO_FIT_COLUMN
Flag property that indicates whether Excel should autofit the current column width.static String
PROPERTY_AUTO_FIT_ROW
Flag property that indicates whether Excel should autofit the current row height.static String
PROPERTY_AVERAGE_CHAR_WIDTH_FACTOR
Property specifying the multiplication factor to be used when calculating the column width for auto fit columns on top of the fill-time calculated average char width.static String
PROPERTY_BREAK_AFTER_ROW
Element level property specifying if a sheet will break after the row displaying that element.static String
PROPERTY_BREAK_BEFORE_ROW
Element level property specifying if a sheet will break before the row displaying that element.static String
PROPERTY_CELL_FORMULA
Property that stores the formula which has to be applied to a given cell in an excel sheet.static String
PROPERTY_CELL_PATTERN
Property that stores the pattern which has to be applied to a given cell in an excel sheet.static String
PROPERTY_COLUMN_NAME
A string that represents the name for the column that should appear in the XLS export.static 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 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.static String
PROPERTY_DATA
Property that specifies what value to associate withPROPERTY_COLUMN_NAME
.static String
PROPERTY_FREEZE_COLUMN_EDGE
This property indicates the vertical edge of the freeze pane, relative to the current cell.static String
PROPERTY_FREEZE_ROW_EDGE
This property indicates the horizontal edge of the freeze pane, relative to the current cell.static String
PROPERTY_IGNORE_ROW_HEIGHT
Flag property that indicates whether the height of the element should contribute to the current row height calculation.static String
PROPERTY_REPEAT_VALUE
Property that specifies whether the value associated withPROPERTY_COLUMN_NAME
should be repeated or not when it is missing.static 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 String
PROPERTY_SHEET_NAME
Property used to set the name of the sheet containing a given element.protected RenderersCache
renderersCache
protected int
reportIndex
protected int
sheetIndex
Used for counting the total number of sheets.protected JRXlsAbstractExporter.SheetInfo
sheetInfo
protected String[]
sheetNames
protected int
sheetNamesIndex
Used for iterating through sheet names.protected Map<String,Integer>
sheetNamesMap
Used when indexing the identical sheet name.protected int
sheetsBeforeCurrentReport
protected Map<Integer,Integer>
sheetsBeforeCurrentReportMap
protected String
workbookTemplate
static String
XLS_EXPORTER_PROPERTIES_PREFIX
-
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_EMPTY_INPUT_SOURCE_IN_BATCH_MODE, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_NO_INPUT_SOURCE, EXCEPTION_MESSAGE_KEY_NO_OUTPUT_SPECIFIED, 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, 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 void
addRowBreak(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
closeSheet()
protected abstract void
closeWorkbook(OutputStream os)
protected void
configureDefinedNames(ExporterNature exporterNature, JRPrintElement element)
protected void
configureDefinedNames(JRPropertiesUtil.PropertySuffix propertySuffix)
protected void
configureDefinedNames(JRPropertiesUtil.PropertySuffix[] names)
protected void
ensureInput()
protected abstract void
exportEmptyReport()
void
exportReport()
Performs the export.protected abstract void
exportReportToStream(OutputStream os)
static String
getColumIndexName(int colIndex, int maxColIndex)
protected int
getColumnIndex(String columnName)
protected String
getColumnName(int columnIndex)
Deprecated.Replaced byJRStringUtil.getLetterNumeral(int, boolean)
.protected String
getConvertedPattern(JRPrintText text, String pattern)
protected JRFont
getDefaultFont()
protected String
getFormula(JRPrintText text)
protected int
getImageBorderCorrection(JRPen pen)
protected Integer
getMaxRowsPerSheet()
protected ExporterNature
getNature()
protected String
getSheetName(String sheetName)
protected String
getSheetName(String sheetName, String defaultSheetName)
protected JRStyledText
getStyledText(JRPrintText textElement)
static ExcelAbstractExporter.TextAlignHolder
getTextAlignHolder(JRPrintText textElement)
protected boolean
hasGlobalSheetNames()
protected void
initExport()
protected void
initReport()
protected boolean
isCellHidden(JRPrintElement element)
protected boolean
isCellLocked(JRPrintElement element)
protected boolean
isIgnoreTextFormatting(JRPrintElement element)
protected boolean
isShrinkToFit(JRPrintElement element)
protected boolean
isUseTimeZone(JRPrintElement element)
protected boolean
isValidScale(Integer scale)
protected boolean
isWrapText(JRPrintElement element)
protected void
mergeAndSetRowLevels(XlsRowLevelInfo levelInfo, SortedMap<String,Boolean> rowLevelMap, int rowIndex)
protected abstract void
openWorkbook(OutputStream os)
protected void
resetAutoFilters()
protected abstract void
setAutoFilter(String autoFilterRange)
protected abstract void
setColumnWidth(int col, int width, boolean autoFit)
protected abstract void
setFreezePane(int rowIndex, int colIndex)
protected abstract void
setRowLevels(XlsRowLevelInfo levelInfo, String level)
protected abstract void
setSheetName(String sheetName)
protected void
setSheetNames()
protected String
toExcelName(String name)
protected Date
translateDateValue(JRPrintText text, Date value)
protected void
updateHeaderFooter(JRXlsAbstractExporter.SheetInfo.SheetPrintSettings printSettings, XlsReportConfiguration configuration)
protected void
updatePrintSettings(JRXlsAbstractExporter.SheetInfo.SheetPrintSettings printSettings, XlsReportConfiguration configuration)
-
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureJasperReportsContext, ensureOutput, getBooleanCellValue, getConfigurationInterface, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterConfiguration, getExporterContext, getExporterInput, getExporterKey, getExporterOutput, getExporterPropertiesPrefix, getHyperlinkProducer, getItemConfigurationInterface, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getPropertiesUtil, getRendererUtil, getReportContext, getReportExportConfiguration, getRepository, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetExportContext, restoreElementOffsets, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperReportsContext, setOffset, setOffset, 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:true
false
- 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:true
false
- 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:true
false
- 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 autofilterStart
values are found in the same sheet, only the last one will be considered. If theStart
value is present but noEnd
value is found in the sheet, then only the current column will be considered for the data range.
If the autofilterStart
value is set on the same row as the autofilterEnd
value, 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 autofilterStart
value.
Caution: If no autofilterStart
value is found in the sheet, the autofilterEnd
value will be considered asStart
value instead.
If multiple autofilterEnd
value are found in the same sheet, only the last one will be considered.
If the autofilterStart
value is set on the same row as the autofilterEnd
value, 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'swidth
attribute.
If defined, this property will override thePROPERTY_COLUMN_WIDTH_RATIO
value for the current column
-
PROPERTY_AVERAGE_CHAR_WIDTH_FACTOR
public static final String PROPERTY_AVERAGE_CHAR_WIDTH_FACTOR
Property specifying the multiplication factor to be used when calculating the column width for auto fit columns on top of the fill-time calculated average char width.- See Also:
- Constant Field Values
-
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.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 (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 theEnd
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_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_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 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'swidth
attribute.
If defined, this property will override both thePROPERTY_COLUMN_WIDTH
value for the current column and the the element'swidth
attribute
-
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 JRException
Description copied from interface:Exporter
Performs the export.- Specified by:
exportReport
in interfaceExporter<ExporterInput,RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput>
- Specified by:
exportReport
in classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>
- Throws:
JRException
-
ensureInput
protected void ensureInput()
- Overrides:
ensureInput
in classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>
-
initExport
protected void initExport()
- Overrides:
initExport
in classJRAbstractExporter<RC extends XlsReportConfiguration,C extends XlsExporterConfiguration,OutputStreamExporterOutput,E extends JRExporterContext>
-
initReport
protected void initReport()
- Overrides:
initReport
in 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:
getStyledText
in 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:
JRException
IOException
-
closeSheet
protected abstract void closeSheet()
-
closeWorkbook
protected abstract void closeWorkbook(OutputStream os) throws JRException, IOException
- Throws:
JRException
IOException
-
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:
JRException
IOException
-
exportEmptyReport
protected abstract void exportEmptyReport() throws JRException, IOException
- Throws:
JRException
IOException
-
-