Class XlsxFormatter
java.lang.Object
io.jmix.reports.yarg.formatters.impl.AbstractFormatter
io.jmix.reports.yarg.formatters.impl.XlsxFormatter
- All Implemented Interfaces:
ReportFormatter
- Direct Known Subclasses:
JmixXlsxFormatter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classprotected static classNested classes/interfaces inherited from class io.jmix.reports.yarg.formatters.impl.AbstractFormatter
AbstractFormatter.BandPathAndParameterName, AbstractFormatter.InlinerAndMatcher -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BandsForRangesprotected DocumentConverterprotected booleanprotected XslxHintProcessorprotected Set<XlsxFormatter.CellWithBand>protected jakarta.xml.bind.Marshallerprotected Set<XlsxFormatter.CellWithBand>protected BandDataprotected intprotected RangeDependenciesprotected Documentprotected Documentprotected jakarta.xml.bind.UnmarshallerFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFormulaForPostProcessing(Range templateRange, BandData bandData, org.xlsx4j.sml.Row newRow, org.xlsx4j.sml.Cell templateCell, org.xlsx4j.sml.Cell newCell) protected RangecalculateFormulaRangeChange(Range formulaRange, Range templateRange, List<Range> resultRanges) protected XlsxFormatter.OffsetcalculateOffset(Range from, Range to) protected org.xlsx4j.sml.CellcopyCell(org.xlsx4j.sml.Cell cell) protected List<org.xlsx4j.sml.Cell>copyCells(Range templateRange, BandData bandData, org.xlsx4j.sml.Row newRow, List<org.xlsx4j.sml.Cell> templateCells) protected List<org.xlsx4j.sml.Cell>copyCells(BandData band, Range templateRange, List<org.xlsx4j.sml.Row> resultSheetRows, org.xlsx4j.sml.Row firstRow, org.xlsx4j.sml.Worksheet resultSheet) protected voidcopyRowSettings(org.xlsx4j.sml.Row templateRow, org.xlsx4j.sml.Row newRow, org.xlsx4j.sml.Worksheet templateWorksheet, org.xlsx4j.sml.Worksheet resultWorksheet) protected voidcreateFakeTemplateCellsForEmptyOnes(Range oneRowRange, Map<CellReference, org.xlsx4j.sml.Cell> cellsForOneRowRange, List<org.xlsx4j.sml.Cell> templateCells) XLSX document does not store empty cells and it might be an issue for formula calculations and etc.protected org.xlsx4j.sml.RowcreateNewRow(org.xlsx4j.sml.Worksheet resultSheet) protected org.xlsx4j.sml.RowensureNecessaryRowsCreated(Range templateRange, org.xlsx4j.sml.Worksheet resultSheet, org.xlsx4j.sml.Row firstRow) protected ByteArrayOutputStreamevaluateFormulas(byte[] content) byte[]extractTemplateImages(ReportTemplate reportTemplate) protected org.xlsx4j.sml.RowfindNextRowForChildBand(BandData band, Range templateRange, List<org.xlsx4j.sml.Row> resultSheetRows) protected org.xlsx4j.sml.RowfindNextRowForFirstRender(Range templateRange, List<org.xlsx4j.sml.Row> resultSheetRows) protected org.xlsx4j.sml.RowfindNextRowForHBand(BandData band, Range templateRange, List<org.xlsx4j.sml.Row> resultSheetRows) protected org.xlsx4j.sml.RowfindNextRowForVBand(BandData band, Range templateRange, List<org.xlsx4j.sml.Row> resultSheetRows) protected voidprotected RangegetBandRange(BandData band) protected <T> Tprotected <T> Tprotected Rangeprotected org.xlsx4j.sml.WorksheetgetTemplateWorksheet(org.xlsx4j.sml.Row newRow) protected org.xlsx4j.sml.WorksheetgetWorksheet(org.xlsx4j.sml.Row newRow) protected voidinit()protected StringinsertBandDataToString(String resultStr) protected booleanisCellInBand(String sheetName, int row, int col) protected booleanprotected voidprotected voidvoidCreates document and serializes it to predefined stream (or something like this)protected voidprotected voidsaveXlsxAsCsv(Document document, OutputStream outputStream) voidsetDocumentConverter(DocumentConverter documentConverter) voidsetFormulasPostProcessingEvaluationEnabled(boolean formulasPostProcessingEvaluationEnabled) protected voidshiftChart(Document.ChartWrapper chart, Range templateRange, Range firstResultRange) protected voidupdateCell(org.docx4j.openpackaging.parts.SpreadsheetML.WorksheetPart worksheetPart, BandData bandData, org.xlsx4j.sml.Cell newCell) protected voidprotected voidprotected voidupdateFormula(org.xlsx4j.sml.Cell cellWithFormula, Range originalFormulaRange, Range formulaRange) protected voidprotected voidprotected voidprotected voidprotected voidprotected voidupdateRangeMappings(BandData band, Range templateRange, List<org.xlsx4j.sml.Cell> resultCells) protected voidprotected voidprotected voidprotected voidwriteHBand(BandData band) protected voidwriteToOutputStream(org.docx4j.openpackaging.packages.SpreadsheetMLPackage mlPackage, OutputStream outputStream) protected voidwriteVBand(BandData 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, hasFormat, inlineParameterValue, insertBandDataToString, isGroovyScript, separateBandNameAndParameterName, setContentInliners, setDefaultFormatProvider, setScripting, unwrapParameterName, wrapWithReportingException, wrapWithReportingException
-
Field Details
-
documentConverter
-
template
-
result
-
rangeDependencies
-
bandsForRanges
-
rangeVerticalIntersections
-
innerFormulas
-
outerFormulas
-
templateImages
-
lastRenderedRangeForBandName
-
lastRowForSheet
-
hintProcessor
-
previousRangeBandData
-
previousRangesRightOffset
protected int previousRangesRightOffset -
formulasPostProcessingEvaluationEnabled
protected boolean formulasPostProcessingEvaluationEnabled -
unmarshaller
protected jakarta.xml.bind.Unmarshaller unmarshaller -
marshaller
protected jakarta.xml.bind.Marshaller marshaller
-
-
Constructor Details
-
XlsxFormatter
-
-
Method Details
-
setDocumentConverter
-
setFormulasPostProcessingEvaluationEnabled
public void setFormulasPostProcessingEvaluationEnabled(boolean formulasPostProcessingEvaluationEnabled) -
renderDocument
public void renderDocument()Description copied from interface:ReportFormatterCreates document and serializes it to predefined stream (or something like this) -
validateTemplateContainsNamedRange
protected void validateTemplateContainsNamedRange() -
saveAndClose
protected void saveAndClose() -
isFormulasPostProcessingEvaluationRequired
protected boolean isFormulasPostProcessingEvaluationRequired() -
evaluateFormulas
-
isCellInBand
-
extractTemplateImages
-
init
protected void init() -
findVerticalDependencies
protected void findVerticalDependencies() -
updateOutlines
protected void updateOutlines() -
updateCharts
protected void updateCharts() -
shiftChart
-
updateFormulas
protected void updateFormulas() -
updateConditionalFormatting
protected void updateConditionalFormatting() -
processOuterFormulas
protected void processOuterFormulas() -
calculateFormulaRangeChange
-
processInnerFormulas
protected void processInnerFormulas() -
updateFormula
-
calculateOffset
-
updatePivotTables
protected void updatePivotTables() -
updateMergeRegions
protected void updateMergeRegions() -
writeBand
-
writeHBand
-
writeVBand
-
updateRangeMappings
-
findNextRowForHBand
-
findNextRowForVBand
-
findNextRowForChildBand
-
findNextRowForFirstRender
-
ensureNecessaryRowsCreated
protected org.xlsx4j.sml.Row ensureNecessaryRowsCreated(Range templateRange, org.xlsx4j.sml.Worksheet resultSheet, org.xlsx4j.sml.Row firstRow) -
copyCells
-
createFakeTemplateCellsForEmptyOnes
protected void createFakeTemplateCellsForEmptyOnes(Range oneRowRange, Map<CellReference, org.xlsx4j.sml.Cell> cellsForOneRowRange, List<org.xlsx4j.sml.Cell> templateCells) XLSX document does not store empty cells and it might be an issue for formula calculations and etc. So we need to create fake template cell for each empty cell. -
getLastRenderedBandForThisLevel
-
getBandRange
-
createNewRow
protected org.xlsx4j.sml.Row createNewRow(org.xlsx4j.sml.Worksheet resultSheet) -
copyCells
-
copyCell
protected org.xlsx4j.sml.Cell copyCell(org.xlsx4j.sml.Cell cell) -
getWorksheet
protected org.xlsx4j.sml.Worksheet getWorksheet(org.xlsx4j.sml.Row newRow) -
getTemplateWorksheet
protected org.xlsx4j.sml.Worksheet getTemplateWorksheet(org.xlsx4j.sml.Row newRow) -
addFormulaForPostProcessing
-
copyRowSettings
protected void copyRowSettings(org.xlsx4j.sml.Row templateRow, org.xlsx4j.sml.Row newRow, org.xlsx4j.sml.Worksheet templateWorksheet, org.xlsx4j.sml.Worksheet resultWorksheet) -
updateCell
protected void updateCell(org.docx4j.openpackaging.parts.SpreadsheetML.WorksheetPart worksheetPart, BandData bandData, org.xlsx4j.sml.Cell newCell) -
getFirst
-
getLast
-
saveXlsxAsCsv
protected void saveXlsxAsCsv(Document document, OutputStream outputStream) throws IOException, org.docx4j.openpackaging.exceptions.Docx4JException - Throws:
IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JException
-
writeToOutputStream
protected void writeToOutputStream(org.docx4j.openpackaging.packages.SpreadsheetMLPackage mlPackage, OutputStream outputStream) throws org.docx4j.openpackaging.exceptions.Docx4JException - Throws:
org.docx4j.openpackaging.exceptions.Docx4JException
-
updateSheetNames
protected void updateSheetNames() -
insertBandDataToString
-