Class XLSFormatter
java.lang.Object
io.jmix.reports.yarg.formatters.impl.AbstractFormatter
io.jmix.reports.yarg.formatters.impl.XLSFormatter
- All Implemented Interfaces:
ReportFormatter
Document formatter for '.xls' file types
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Bounds of region [(x,y) : (x1, y1)]protected static class
Cell range at sheetNested classes/interfaces inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatter
AbstractFormatter.BandPathAndParameterName, AbstractFormatter.InlinerAndMatcher
-
Field Summary
Modifier and TypeFieldDescriptionprotected AreaDependencyManager
protected int
protected org.apache.poi.hssf.usermodel.HSSFSheet
protected DocumentConverter
protected Map<org.apache.poi.hssf.usermodel.HSSFSheet,
org.apache.poi.hssf.usermodel.HSSFPatriarch> protected static final String
protected XlsFontCache
protected Map<String,
List<XLSFormatter.SheetRange>> protected org.apache.poi.hssf.usermodel.HSSFWorkbook
protected int
protected int
protected int
protected XlsStyleCache
protected Map<String,
XLSFormatter.Bounds> protected Map<org.apache.poi.hssf.usermodel.HSSFSheet,
org.apache.poi.hssf.usermodel.HSSFSheet> protected org.apache.poi.hssf.usermodel.HSSFWorkbook
Fields inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatter
ALIAS_GROUP, ALIAS_WITH_BAND_NAME_PATTERN, ALIAS_WITH_BAND_NAME_REGEXP, BAND_NAME_DECLARATION_PATTERN, BAND_NAME_DECLARATION_REGEXP, contentInliners, defaultFormatProvider, groovyScriptParametersProvider, outputStream, outputType, reportTemplate, rootBand, scripting, SIMPLE_ALIAS_REGEXP, STRING_FUNCTION_GROUP, supportedOutputTypes, UNIVERSAL_ALIAS_PATTERN, UNIVERSAL_ALIAS_REGEXP, VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addRangeBounds
(BandData band, org.apache.poi.ss.util.CellReference[] crefs) This method adds range bounds to cache.protected void
protected void
cleanupCells
(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) protected org.apache.poi.hssf.usermodel.HSSFCellStyle
copyCellStyle
(org.apache.poi.hssf.usermodel.HSSFCellStyle templateStyle) protected void
copyCharts
(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) protected void
copyMergeRegions
(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet, String rangeName, int firstTargetRangeRow, int firstTargetRangeColumn) Create new merge regions in result sheet identically to range's merge regions from template.protected void
copyPageBreaks
(org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet, int templateRowIndex, int resultRowIndex) protected void
protected void
copyPicturesFromTemplateToResult
(org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) Copies all pictures from template sheet to result sheet, shift picture depending on area dependenciesprotected void
protected String
extractStyles
(org.apache.poi.hssf.usermodel.HSSFCell templateCell, org.apache.poi.hssf.usermodel.HSSFCell resultCell, String templateCellValue, BandData bandData) protected Cell
getCellFromTemplate
(Cell cell) protected org.apache.poi.hssf.record.EscherAggregate
getEscherAggregate
(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Returns EscherAggregate from sheetprotected void
initMergeRegions
(org.apache.poi.hssf.usermodel.HSSFSheet currentSheet) Method creates mapping [rangeName : List<CellRangeAddress>].protected void
protected void
protected String
inlineBandDataToCellString
(org.apache.poi.hssf.usermodel.HSSFCell cell, String templateCellValue, BandData band) protected boolean
intersects
(org.apache.poi.ss.util.CellRangeAddress x, org.apache.poi.ss.util.CellRangeAddress y) protected void
protected void
protected void
removeMergedRegions
(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) void
Creates document and serializes it to predefined stream (or something like this)protected boolean
rowExists
(org.apache.poi.hssf.usermodel.HSSFSheet sheet, int rowNumber) void
setDocumentConverter
(DocumentConverter documentConverter) protected void
setValueToCell
(org.apache.poi.hssf.usermodel.HSSFCell resultCell, String cellValue, org.apache.poi.ss.usermodel.CellType cellType) protected void
updateCell
(Cell cell) protected void
protected void
updateFormulas
(Area templateArea, Area dependentResultArea) protected void
updateValueCell
(BandData rootBand, BandData bandData, String templateCellValue, org.apache.poi.hssf.usermodel.HSSFCell resultCell, org.apache.poi.hssf.usermodel.HSSFPatriarch patriarch) Copies template cell to result cell and fills it with bandData dataprotected void
protected void
writeHorizontalBand
(BandData band, org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) Method writes horizontal band Note: Only one band for row is supported.protected void
writeVerticalBand
(BandData band, org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) Method writes vertical band Note: no child support for vertical band ;)Methods inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatter
applyStringFunction, checkThreadInterrupted, containsJustOneAlias, createDocument, defaultFormat, findBandByPath, formatValue, formatValue, getAllAliases, getContentInlinerForFormat, getContentInliners, getFormatString, getFullParameterName, inlineParameterValue, insertBandDataToString, isGroovyScript, separateBandNameAndParameterName, setContentInliners, setDefaultFormatProvider, setScripting, unwrapParameterName, wrapWithReportingException, wrapWithReportingException
-
Field Details
-
DYNAMIC_HEIGHT_STYLE
- See Also:
-
templateWorkbook
protected org.apache.poi.hssf.usermodel.HSSFWorkbook templateWorkbook -
resultWorkbook
protected org.apache.poi.hssf.usermodel.HSSFWorkbook resultWorkbook -
currentTemplateSheet
protected org.apache.poi.hssf.usermodel.HSSFSheet currentTemplateSheet -
fontCache
-
styleCache
-
rownum
protected int rownum -
colnum
protected int colnum -
rowsAddedByVerticalBand
protected int rowsAddedByVerticalBand -
rowsAddedByHorizontalBand
protected int rowsAddedByHorizontalBand -
mergeRegionsForRangeNames
-
templateToResultSheetsMapping
protected Map<org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi.hssf.usermodel.HSSFSheet> templateToResultSheetsMapping -
templateBounds
-
areaDependencyManager
-
areasDependency
-
orderedPicturesId
-
sheetToEscherAggregate
-
drawingPatriarchsMap
protected Map<org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi.hssf.usermodel.HSSFPatriarch> drawingPatriarchsMap -
hints
-
documentConverter
-
bandsToResultRanges
-
-
Constructor Details
-
XLSFormatter
-
-
Method Details
-
setDocumentConverter
-
renderDocument
public void renderDocument()Description copied from interface:ReportFormatter
Creates document and serializes it to predefined stream (or something like this) -
initWorkbook
protected void initWorkbook() -
initNamedStyleCache
protected void initNamedStyleCache() -
processDocument
protected void processDocument() -
applyHints
protected void applyHints() -
outputDocument
protected void outputDocument() -
copyPicturesToResultWorkbook
protected void copyPicturesToResultWorkbook() -
removeMergedRegions
protected void removeMergedRegions(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) -
cleanupCells
protected void cleanupCells(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) -
copyCharts
protected void copyCharts(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) -
updateFormulas
protected void updateFormulas() -
copyPictures
protected void copyPictures() -
writeBand
-
writeHorizontalBand
protected void writeHorizontalBand(BandData band, org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) Method writes horizontal band Note: Only one band for row is supported. Now we think that many bands for row aren't usable.- Parameters:
band
- - band to writetemplateSheet
- - template sheetresultSheet
- - result sheet
-
writeVerticalBand
protected void writeVerticalBand(BandData band, org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) Method writes vertical band Note: no child support for vertical band ;)- Parameters:
band
- - band to writetemplateSheet
- - template sheetresultSheet
- - result sheet
-
initMergeRegions
protected void initMergeRegions(org.apache.poi.hssf.usermodel.HSSFSheet currentSheet) Method creates mapping [rangeName : List<CellRangeAddress>]. List contains all merge regions for this named range. Attention: if merged regions writes wrong - look on methods isMergeRegionInsideNamedRange or isNamedRangeInsideMergeRegion todo: how to recognize if merge region must be copied with named range- Parameters:
currentSheet
- Sheet which contains merge regions
-
copyMergeRegions
protected void copyMergeRegions(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet, String rangeName, int firstTargetRangeRow, int firstTargetRangeColumn) Create new merge regions in result sheet identically to range's merge regions from template. Not support copy of frames and rules- Parameters:
resultSheet
- - result sheetrangeName
- - range namefirstTargetRangeRow
- - first column of target rangefirstTargetRangeColumn
- - first column of target range
-
intersects
protected boolean intersects(org.apache.poi.ss.util.CellRangeAddress x, org.apache.poi.ss.util.CellRangeAddress y) -
updateValueCell
protected void updateValueCell(BandData rootBand, BandData bandData, String templateCellValue, org.apache.poi.hssf.usermodel.HSSFCell resultCell, org.apache.poi.hssf.usermodel.HSSFPatriarch patriarch) Copies template cell to result cell and fills it with bandData data- Parameters:
bandData
- - bandDatatemplateCellValue
- - template cell valueresultCell
- - result cell
-
setValueToCell
protected void setValueToCell(org.apache.poi.hssf.usermodel.HSSFCell resultCell, String cellValue, org.apache.poi.ss.usermodel.CellType cellType) -
inlineBandDataToCellString
-
addRangeBounds
This method adds range bounds to cache. Key is bandName- Parameters:
band
- - bandcrefs
- - range
-
updateFormulas
-
extractStyles
-
copyCellStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle copyCellStyle(org.apache.poi.hssf.usermodel.HSSFCellStyle templateStyle) -
getEscherAggregate
protected org.apache.poi.hssf.record.EscherAggregate getEscherAggregate(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Returns EscherAggregate from sheet- Parameters:
sheet
- - HSSFSheet- Returns:
- - EscherAggregate from sheet
-
copyPicturesFromTemplateToResult
protected void copyPicturesFromTemplateToResult(org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) Copies all pictures from template sheet to result sheet, shift picture depending on area dependencies- Parameters:
templateSheet
- - template sheetresultSheet
- - result sheet
-
rowExists
protected boolean rowExists(org.apache.poi.hssf.usermodel.HSSFSheet sheet, int rowNumber) -
getCellFromTemplate
-
updateCell
-
copyPageBreaks
protected void copyPageBreaks(org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet, int templateRowIndex, int resultRowIndex)
-