Class ExcelExporter
java.lang.Object
io.jmix.gridexportflowui.exporter.AbstractDataGridExporter<ExcelExporter>
io.jmix.gridexportflowui.exporter.excel.ExcelExporter
- All Implemented Interfaces:
DataGridExporter
@Component("grdexp_ExcelExporter")
@Scope("prototype")
public class ExcelExporter
extends AbstractDataGridExporter<ExcelExporter>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.gridexportflowui.exporter.DataGridExporter
DataGridExporter.ColumnValueContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AllRecordsExporterprotected org.apache.poi.ss.usermodel.Fontprotected static final intprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected booleanprotected Booleanprotected GridExportPropertiesprotected org.apache.poi.ss.usermodel.CellStyleprotected booleanstatic final intprotected org.apache.poi.ss.usermodel.Sheetprotected ExcelAutoColumnSizer[]protected org.apache.poi.ss.usermodel.Fontprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.WorkbookFields inherited from class io.jmix.gridexportflowui.exporter.AbstractDataGridExporter
columnValueProviders, coreProperties, datatypeRegistry, fileName, flowuiProperties, messages, messageTools, metadataTools -
Constructor Summary
ConstructorsConstructorDescriptionExcelExporter(GridExportProperties gridExportProperties, AllRecordsExporter allRecordsExporter) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckIsRowNumberExceed(int r) protected voidcreateAutoColumnSizers(int count) protected intcreateDataGridHierarchicalRow(com.vaadin.flow.component.treegrid.TreeGrid<?> dataGrid, ContainerTreeDataGridItems<Object> treeDataGridItems, List<com.vaadin.flow.component.grid.Grid.Column<Object>> columns, int startColumn, int rowNumber, Object item) protected voidcreateDataGridRow(com.vaadin.flow.component.grid.Grid<?> dataGrid, List<com.vaadin.flow.component.grid.Grid.Column<Object>> columns, int startColumn, int rowNumber, Object itemId) protected voidcreateDataGridRowForEntityInstance(com.vaadin.flow.component.grid.Grid<?> dataGrid, List<com.vaadin.flow.component.grid.Grid.Column<Object>> columns, int startColumn, int rowNumber, Object entityInstance, boolean addLevelPadding) protected voidprotected voidprotected Function<Object,InstanceContainer<Object>> createInstanceContainerProvider(com.vaadin.flow.component.grid.Grid<?> dataGrid, Object item) protected StringcreateSpaceString(int level) protected voidprotected voidvoidexportDataGrid(Downloader downloader, com.vaadin.flow.component.grid.Grid<Object> dataGrid, ExportMode exportMode) downloaddataGridcontent viadownloaderprotected voidformatValueCell(org.apache.poi.ss.usermodel.Cell cell, Object cellValue, MetaPropertyPath metaPropertyPath, int sizersIndex, int notificationRequired, int level, Integer groupChildCount) protected shortgetBuiltinFormat(String format) booleangetLabel()protected StringgetMessage(String id) voidsetExportAggregation(boolean exportAggregation) Export table with aggregationvoidsetExportExpanded(Boolean exportExpanded) Export tree table with expanded rowswithExportAggregation(Boolean exportAggregation) Export table with aggregationwithExportExpanded(Boolean exportExpanded) Export tree table with expanded rowsMethods inherited from class io.jmix.gridexportflowui.exporter.AbstractDataGridExporter
addColumnValueProvider, formatValue, formatValue, getColumnValue, getColumnValueProvider, getFileName, getFileName, getMetaClassName, removeColumnValueProvider, setCoreProperties, setDatatypeRegistry, setFileName, setFlowuiProperties, setMessages, setMessageTools, setMetadataTools, withFileName
-
Field Details
-
COL_WIDTH_MAGIC
protected static final int COL_WIDTH_MAGIC- See Also:
-
MAX_ROW_COUNT
public static final int MAX_ROW_COUNT -
wb
protected org.apache.poi.ss.usermodel.Workbook wb -
boldFont
protected org.apache.poi.ss.usermodel.Font boldFont -
stdFont
protected org.apache.poi.ss.usermodel.Font stdFont -
sheet
protected org.apache.poi.ss.usermodel.Sheet sheet -
timeFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle timeFormatCellStyle -
dateFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle dateFormatCellStyle -
dateTimeFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle dateTimeFormatCellStyle -
integerFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle integerFormatCellStyle -
doubleFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle doubleFormatCellStyle -
sizers
-
exportAggregation
protected boolean exportAggregation -
exportExpanded
-
isRowNumberExceeded
protected boolean isRowNumberExceeded -
gridExportProperties
-
allRecordsExporter
-
-
Constructor Details
-
ExcelExporter
public ExcelExporter(GridExportProperties gridExportProperties, AllRecordsExporter allRecordsExporter)
-
-
Method Details
-
createWorkbookWithSheet
protected void createWorkbookWithSheet() -
createFonts
protected void createFonts() -
createAutoColumnSizers
protected void createAutoColumnSizers(int count) -
exportDataGrid
public void exportDataGrid(Downloader downloader, com.vaadin.flow.component.grid.Grid<Object> dataGrid, ExportMode exportMode) Description copied from interface:DataGridExporterdownloaddataGridcontent viadownloader -
createDataGridHierarchicalRow
protected int createDataGridHierarchicalRow(com.vaadin.flow.component.treegrid.TreeGrid<?> dataGrid, ContainerTreeDataGridItems<Object> treeDataGridItems, List<com.vaadin.flow.component.grid.Grid.Column<Object>> columns, int startColumn, int rowNumber, Object item) -
createDataGridRow
-
createDataGridRowForEntityInstance
-
createInstanceContainerProvider
protected Function<Object,InstanceContainer<Object>> createInstanceContainerProvider(com.vaadin.flow.component.grid.Grid<?> dataGrid, Object item) - Overrides:
createInstanceContainerProviderin classAbstractDataGridExporter<ExcelExporter>
-
createFormats
protected void createFormats() -
getBuiltinFormat
-
getMessage
-
createSpaceString
-
formatValueCell
protected void formatValueCell(org.apache.poi.ss.usermodel.Cell cell, @Nullable Object cellValue, @Nullable MetaPropertyPath metaPropertyPath, int sizersIndex, int notificationRequired, int level, @Nullable Integer groupChildCount) -
checkIsRowNumberExceed
protected boolean checkIsRowNumberExceed(int r) -
getExportAggregation
public boolean getExportAggregation()- Returns:
- export aggregation
-
setExportAggregation
public void setExportAggregation(boolean exportAggregation) Export table with aggregation- Parameters:
exportAggregation- set to true to export table with aggregation
-
withExportAggregation
Export table with aggregation- Parameters:
exportAggregation- set to true to export table with aggregation- Returns:
- exporter instance
-
getExportExpanded
- Returns:
- tree table export expanded
-
setExportExpanded
Export tree table with expanded rows- Parameters:
exportExpanded- set to true to export collapsed items in expanded view
-
withExportExpanded
Export tree table with expanded rows- Parameters:
exportExpanded- set to true to export collapsed items in expanded view- Returns:
- exporter instance
-
getLabel
- Returns:
- exporter label
-
disposeWorkBook
protected void disposeWorkBook()
-