public abstract class JRXlsAbstractExporter extends JRAbstractExporter
Modifier and Type | Class and Description |
---|---|
protected static class |
JRXlsAbstractExporter.TextAlignHolder |
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.ParameterOverriddenResolver, JRAbstractExporter.ParameterOverrideResolver, JRAbstractExporter.ParameterResolver
Modifier and Type | Field and Description |
---|---|
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.util.Map<java.lang.String,java.lang.String> |
fontMap
Deprecated.
|
protected java.util.Map<java.lang.String,java.lang.String> |
formatPatternsMap |
protected int |
gridColumnFreezeIndex |
protected int |
gridRowFreezeIndex |
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.util.List<java.lang.Object> |
loadedFonts |
static int |
MAX_COLUMN_INDEX |
static int |
MAX_ROW_INDEX |
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 |
static java.lang.String |
PROPERTY_AUTO_FIT_ROW |
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_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_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_WRAP_TEXT
This property indicates whether text wrapping is allowed in a given cell.
|
protected int |
reportIndex |
protected RunDirectionEnum |
sheetDirection |
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 boolean |
wrapText |
protected static java.lang.String |
XLS_EXPORTER_PROPERTIES_PREFIX |
dateFormatCache, endPageIndex, filter, globalOffsetX, globalOffsetY, hyperlinkProducerFactory, isModeBatch, jasperPrint, jasperPrintList, numberFormatCache, parameters, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, startPageIndex
Constructor and Description |
---|
JRXlsAbstractExporter() |
Modifier and Type | Method and Description |
---|---|
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) |
protected boolean |
isCellHidden(JRPrintElement element) |
protected boolean |
isCellLocked(JRPrintElement element) |
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) |
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 abstract void |
setSheetName(java.lang.String sheetName) |
protected void |
setSheetNames() |
protected abstract void |
updateColumn(int col,
boolean autoFit) |
protected void |
updateColumns(CutsInfo xCuts) |
createFilter, defaultParseNumber, getBooleanCellValue, getBooleanParameter, getCharacterParameter, getCustomHandler, getDateCellValue, getDateFormat, getExporterKey, getFloatParameter, getHyperlinkProducer, getIntegerParameter, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getParameter, getParameterResolver, getParameters, getReportContext, getStringArrayParameter, getStringParameter, getStringParameterOrDefault, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setExportContext, setFrameElementsOffset, setHyperlinkProducerFactory, setInput, setJasperPrint, setOffset, setOffset, setOutput, setPageRange, setParameter, setParameters, setReportContext
protected static final java.lang.String XLS_EXPORTER_PROPERTIES_PREFIX
public static final java.lang.String PROPERTY_CELL_FORMULA
public static final java.lang.String PROPERTY_CELL_PATTERN
public static final java.lang.String PROPERTY_WRAP_TEXT
The property itself defaults to true
.
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_FIT_WIDTH
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_FIT_HEIGHT
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_CELL_LOCKED
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_CELL_HIDDEN
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SHEET_HEADER_LEFT
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SHEET_HEADER_CENTER
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SHEET_HEADER_RIGHT
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SHEET_FOOTER_LEFT
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SHEET_FOOTER_CENTER
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SHEET_FOOTER_RIGHT
JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_SHEET_DIRECTION
JRProperties
,
RunDirectionEnum
,
Constant Field Valuespublic static final java.lang.String PROPERTY_FREEZE_ROW
public static final java.lang.String PROPERTY_FREEZE_COLUMN
public static final java.lang.String PROPERTY_FREEZE_ROW_EDGE
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.public static final java.lang.String PROPERTY_FREEZE_COLUMN_EDGE
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.public static final java.lang.String PROPERTY_AUTO_FIT_ROW
public static final java.lang.String PROPERTY_AUTO_FIT_COLUMN
public static final java.lang.String PROPERTY_AUTO_FILTER
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").
Start
values are found in the same sheet, only the last one will be considered. If the
Start
value is present but no End
value is found in the sheet, then only the current column will
be considered for the data range.
Start
value is set on the same row as the autofilter End
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 autofilter Start
value.
Start
value is found in the sheet, the autofilter End
value will be considered
as Start
value instead.
End
value are found in the same sheet, only the last one will be considered.
Start
value is set on the same row as the autofilter End
value, the data range
will include all data below this heading row, placed between the start column and the end column.JRProperties
,
Constant Field Valuespublic static final java.lang.String PROPERTY_COLUMN_WIDTH
width
attribute.
PROPERTY_COLUMN_WIDTH_RATIO
value for the current columnpublic static final java.lang.String PROPERTY_COLUMN_WIDTH_RATIO
PROPERTY_COLUMN_WIDTH
property will override the
PROPERTY_COLUMN_WIDTH_RATIO
value for that column only.public static final java.lang.String PROPERTY_ROW_OUTLINE_LEVEL_PREFIX
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.
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.JRProperties
,
Constant Field Valuespublic static final int MAX_ROW_INDEX
public static final int MAX_COLUMN_INDEX
protected java.util.List<java.lang.Object> loadedFonts
protected boolean isOnePagePerSheet
protected boolean isRemoveEmptySpaceBetweenRows
protected boolean isRemoveEmptySpaceBetweenColumns
protected boolean isWhitePageBackground
protected boolean isDetectCellType
protected boolean isFontSizeFixEnabled
protected boolean isImageBorderFixEnabled
protected boolean isIgnoreGraphics
protected boolean createCustomPalette
protected boolean isCollapseRowSpan
protected boolean isIgnoreCellBorder
protected boolean isIgnoreCellBackground
protected boolean wrapText
protected boolean cellLocked
protected boolean cellHidden
protected int maxRowsPerSheet
protected java.lang.String[] sheetNames
protected java.lang.String sheetHeaderLeft
protected java.lang.String sheetHeaderCenter
protected java.lang.String sheetHeaderRight
protected java.lang.String sheetFooterLeft
protected java.lang.String sheetFooterCenter
protected java.lang.String sheetFooterRight
protected RunDirectionEnum sheetDirection
protected java.util.Map<java.lang.String,java.lang.String> formatPatternsMap
protected JRExportProgressMonitor progressMonitor
protected int reportIndex
protected int pageIndex
protected java.util.Map<java.lang.String,java.lang.String> fontMap
protected JRFont defaultFont
protected int sheetIndex
protected int sheetNamesIndex
protected java.util.Map<java.lang.String,java.lang.Integer> sheetNamesMap
protected boolean isIgnorePageMargins
protected int gridRowFreezeIndex
protected int gridColumnFreezeIndex
protected int maxRowFreezeIndex
protected int maxColumnFreezeIndex
protected boolean isFreezeRowEdge
protected boolean isFreezeColumnEdge
protected java.lang.String autoFilterStart
protected java.lang.String autoFilterEnd
protected java.lang.Float columnWidthRatio
protected JRFont getDefaultFont()
public void exportReport() throws JRException
JRExporter
exportReport
in interface JRExporter
exportReport
in class JRAbstractExporter
JRException
protected void setParameters()
protected void setExporterHints()
protected abstract void setBackground()
protected void exportReportToStream(java.io.OutputStream os) throws JRException
JRException
protected int exportPage(JRPrintPage page, CutsInfo xCuts, int startRow) throws JRException
JRException
protected void mergeAndSetRowLevels(XlsRowLevelInfo levelInfo, java.util.SortedMap<java.lang.String,java.lang.Boolean> rowLevelMap, int rowIndex)
protected void setColumnWidths(CutsInfo xCuts)
protected void updateColumns(CutsInfo xCuts)
protected JRStyledText getStyledText(JRPrintText textElement)
getStyledText
in class JRAbstractExporter
protected static JRXlsAbstractExporter.TextAlignHolder getTextAlignHolder(JRPrintText textElement)
protected int getImageBorderCorrection(JRPen pen)
protected final int calculateWidthForDinAN(int n)
protected final int calculateHeightForDinAN(int n)
protected final int calculateWidthForDinBN(int n)
protected final int calculateHeightForDinBN(int n)
protected final int calculateWidthForDinCN(int n)
protected final int calculateHeightForDinCN(int n)
protected boolean isWrapText(JRPrintElement element)
protected boolean isCellLocked(JRPrintElement element)
protected java.lang.String getFormula(JRPrintText text)
protected void setSheetNames()
protected boolean isCellHidden(JRPrintElement element)
protected java.lang.String getConvertedPattern(JRPrintText text, java.lang.String pattern)
protected int getColumnIndex(java.lang.String columnName)
protected java.lang.String getColumnName(int columnIndex)
protected void setFreezePane(int rowIndex, int colIndex)
protected void resetAutoFilters()
protected abstract ExporterNature getNature()
protected abstract void openWorkbook(java.io.OutputStream os) throws JRException
JRException
protected abstract void createSheet(java.lang.String name)
protected abstract void closeWorkbook(java.io.OutputStream os) throws JRException
JRException
protected abstract void setColumnWidth(int col, int width, boolean autoFit)
protected abstract void removeColumn(int col)
protected abstract void updateColumn(int col, boolean autoFit)
protected abstract void setRowHeight(int rowIndex, int lastRowHeight, Cut yCut, XlsRowLevelInfo levelInfo) throws JRException
JRException
protected abstract void setCell(JRExporterGridCell gridCell, int colIndex, int rowIndex)
protected abstract void addBlankCell(JRExporterGridCell gridCell, int colIndex, int rowIndex) throws JRException
JRException
protected abstract void addOccupiedCell(OccupiedGridCell occupiedGridCell, int colIndex, int rowIndex) throws JRException
JRException
protected abstract void exportText(JRPrintText text, JRExporterGridCell cell, int colIndex, int rowIndex) throws JRException
JRException
protected abstract void exportImage(JRPrintImage image, JRExporterGridCell cell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout) throws JRException
JRException
protected abstract void exportRectangle(JRPrintGraphicElement element, JRExporterGridCell cell, int colIndex, int rowIndex) throws JRException
JRException
protected abstract void exportLine(JRPrintLine line, JRExporterGridCell cell, int colIndex, int rowIndex) throws JRException
JRException
protected abstract void exportFrame(JRPrintFrame frame, JRExporterGridCell cell, int colIndex, int rowIndex) throws JRException
JRException
protected abstract void exportGenericElement(JRGenericPrintElement element, JRExporterGridCell cell, int colIndex, int rowIndex, int emptyCols, int yCutsRow, JRGridLayout layout) throws JRException
JRException
protected abstract void setFreezePane(int rowIndex, int colIndex, boolean isRowEdge, boolean isColumnEdge)
protected abstract void setSheetName(java.lang.String sheetName)
protected abstract void setAutoFilter(java.lang.String autoFilterRange)
protected abstract void setRowLevels(XlsRowLevelInfo levelInfo, java.lang.String level)
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com