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 SummaryNested ClassesModifier and TypeClassDescriptionprotected static classBounds of region [(x,y) : (x1, y1)]protected static classCell range at sheetNested classes/interfaces inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatterAbstractFormatter.BandPathAndParameterName, AbstractFormatter.InlinerAndMatcher
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected AreaDependencyManagerprotected intprotected org.apache.poi.hssf.usermodel.HSSFSheetprotected DocumentConverterprotected Map<org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi.hssf.usermodel.HSSFPatriarch> protected static final Stringprotected XlsFontCacheprotected Map<String,List<XLSFormatter.SheetRange>> protected org.apache.poi.hssf.usermodel.HSSFWorkbookprotected intprotected intprotected intprotected XlsStyleCacheprotected Map<String,XLSFormatter.Bounds> protected Map<org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi.hssf.usermodel.HSSFSheet> protected org.apache.poi.hssf.usermodel.HSSFWorkbookFields inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatterALIAS_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddRangeBounds(BandData band, org.apache.poi.ss.util.CellReference[] crefs) This method adds range bounds to cache.protected voidprotected voidcleanupCells(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) protected org.apache.poi.hssf.usermodel.HSSFCellStylecopyCellStyle(org.apache.poi.hssf.usermodel.HSSFCellStyle templateStyle) protected voidcopyCharts(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) protected voidcopyMergeRegions(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 voidcopyPageBreaks(org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet, int templateRowIndex, int resultRowIndex) protected voidprotected voidcopyPicturesFromTemplateToResult(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 voidprotected StringextractStyles(org.apache.poi.hssf.usermodel.HSSFCell templateCell, org.apache.poi.hssf.usermodel.HSSFCell resultCell, String templateCellValue, BandData bandData) protected CellgetCellFromTemplate(Cell cell) protected org.apache.poi.hssf.record.EscherAggregategetEscherAggregate(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Returns EscherAggregate from sheetprotected voidinitMergeRegions(org.apache.poi.hssf.usermodel.HSSFSheet currentSheet) Method creates mapping [rangeName : List<CellRangeAddress>].protected voidprotected voidprotected StringinlineBandDataToCellString(org.apache.poi.hssf.usermodel.HSSFCell cell, String templateCellValue, BandData band) protected booleanintersects(org.apache.poi.ss.util.CellRangeAddress x, org.apache.poi.ss.util.CellRangeAddress y) protected voidprotected voidprotected voidremoveMergedRegions(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) voidCreates document and serializes it to predefined stream (or something like this)protected booleanrowExists(org.apache.poi.hssf.usermodel.HSSFSheet sheet, int rowNumber) voidsetDocumentConverter(DocumentConverter documentConverter) protected voidsetValueToCell(org.apache.poi.hssf.usermodel.HSSFCell resultCell, String cellValue, org.apache.poi.ss.usermodel.CellType cellType) protected voidupdateCell(Cell cell) protected voidprotected voidupdateFormulas(Area templateArea, Area dependentResultArea) protected voidupdateValueCell(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 voidprotected voidwriteHorizontalBand(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 voidwriteVerticalBand(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.AbstractFormatterapplyStringFunction, 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:
 
- 
templateWorkbookprotected org.apache.poi.hssf.usermodel.HSSFWorkbook templateWorkbook
- 
resultWorkbookprotected org.apache.poi.hssf.usermodel.HSSFWorkbook resultWorkbook
- 
currentTemplateSheetprotected org.apache.poi.hssf.usermodel.HSSFSheet currentTemplateSheet
- 
fontCache
- 
styleCache
- 
rownumprotected int rownum
- 
colnumprotected int colnum
- 
rowsAddedByVerticalBandprotected int rowsAddedByVerticalBand
- 
rowsAddedByHorizontalBandprotected int rowsAddedByHorizontalBand
- 
mergeRegionsForRangeNames
- 
templateToResultSheetsMappingprotected Map<org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi.hssf.usermodel.HSSFSheet> templateToResultSheetsMapping
- 
templateBounds
- 
areaDependencyManager
- 
areasDependency
- 
orderedPicturesId
- 
sheetToEscherAggregate
- 
drawingPatriarchsMapprotected Map<org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi.hssf.usermodel.HSSFPatriarch> drawingPatriarchsMap
- 
hints
- 
documentConverter
- 
bandsToResultRanges
 
- 
- 
Constructor Details- 
XLSFormatter
 
- 
- 
Method Details- 
setDocumentConverter
- 
renderDocumentpublic void renderDocument()Description copied from interface:ReportFormatterCreates document and serializes it to predefined stream (or something like this)
- 
initWorkbookprotected void initWorkbook()
- 
initNamedStyleCacheprotected void initNamedStyleCache()
- 
processDocumentprotected void processDocument()
- 
applyHintsprotected void applyHints()
- 
outputDocumentprotected void outputDocument()
- 
copyPicturesToResultWorkbookprotected void copyPicturesToResultWorkbook()
- 
removeMergedRegionsprotected void removeMergedRegions(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) 
- 
cleanupCellsprotected void cleanupCells(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) 
- 
copyChartsprotected void copyCharts(org.apache.poi.hssf.usermodel.HSSFSheet resultSheet) 
- 
updateFormulasprotected void updateFormulas()
- 
copyPicturesprotected void copyPictures()
- 
writeBand
- 
writeHorizontalBandprotected 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 write
- templateSheet- - template sheet
- resultSheet- - result sheet
 
- 
writeVerticalBandprotected 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 write
- templateSheet- - template sheet
- resultSheet- - result sheet
 
- 
initMergeRegionsprotected 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
 
- 
copyMergeRegionsprotected 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 sheet
- rangeName- - range name
- firstTargetRangeRow- - first column of target range
- firstTargetRangeColumn- - first column of target range
 
- 
intersectsprotected boolean intersects(org.apache.poi.ss.util.CellRangeAddress x, org.apache.poi.ss.util.CellRangeAddress y) 
- 
updateValueCellprotected 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- - bandData
- templateCellValue- - template cell value
- resultCell- - result cell
 
- 
setValueToCellprotected void setValueToCell(org.apache.poi.hssf.usermodel.HSSFCell resultCell, String cellValue, org.apache.poi.ss.usermodel.CellType cellType) 
- 
inlineBandDataToCellString
- 
addRangeBoundsThis method adds range bounds to cache. Key is bandName- Parameters:
- band- - band
- crefs- - range
 
- 
updateFormulas
- 
extractStyles
- 
copyCellStyleprotected org.apache.poi.hssf.usermodel.HSSFCellStyle copyCellStyle(org.apache.poi.hssf.usermodel.HSSFCellStyle templateStyle) 
- 
getEscherAggregateprotected 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
 
- 
copyPicturesFromTemplateToResultprotected 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 sheet
- resultSheet- - result sheet
 
- 
rowExistsprotected boolean rowExists(org.apache.poi.hssf.usermodel.HSSFSheet sheet, int rowNumber) 
- 
getCellFromTemplate
- 
updateCell
- 
copyPageBreaksprotected void copyPageBreaks(org.apache.poi.hssf.usermodel.HSSFSheet templateSheet, org.apache.poi.hssf.usermodel.HSSFSheet resultSheet, int templateRowIndex, int resultRowIndex) 
 
-