public class ExcelExporter
extends java.lang.Object
Table
into Excel format
and show using ExportDisplay
.
exportTable
methods.Modifier and Type | Class and Description |
---|---|
static class |
ExcelExporter.ExportMode |
Modifier and Type | Field and Description |
---|---|
protected org.apache.poi.ss.usermodel.Font |
boldFont |
protected static int |
COL_WIDTH_MAGIC |
protected org.apache.poi.ss.usermodel.CellStyle |
dateFormatCellStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
dateTimeFormatCellStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
doubleFormatCellStyle |
protected ExcelExportHelper |
excelExportHelper |
protected ExcelOptions |
excelOptions |
protected boolean |
exportAggregation |
protected java.lang.String |
falseStr |
protected org.apache.poi.ss.usermodel.CellStyle |
integerFormatCellStyle |
protected boolean |
isRowNumberExceeded |
static int |
MAX_ROW_COUNT |
protected Messages |
messages |
protected MetadataTools |
metadataTools |
protected org.apache.poi.ss.usermodel.Sheet |
sheet |
protected ExcelAutoColumnSizer[] |
sizers |
protected org.apache.poi.ss.usermodel.Font |
stdFont |
protected org.apache.poi.ss.usermodel.CellStyle |
timeFormatCellStyle |
protected java.lang.String |
trueStr |
protected UserSessionSource |
userSessionSource |
protected org.apache.poi.ss.usermodel.Workbook |
wb |
Constructor and Description |
---|
ExcelExporter() |
ExcelExporter(ExcelExportFormat excelExportFormat) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkIsRowNumberExceed(int r) |
protected int |
createAggregatableRow(Table table,
java.util.List<Table.Column> columns,
int rowNumber,
int aggregatableRow) |
protected void |
createAutoColumnSizers(int count) |
protected int |
createDataGridHierarchicalRow(TreeDataGrid dataGrid,
TreeDataGridItems<Entity> treeDataGridItems,
java.util.List<DataGrid.Column> columns,
int startColumn,
int rowNumber,
Entity item) |
protected void |
createDataGridRow(DataGrid dataGrid,
java.util.List<DataGrid.Column> columns,
int startColumn,
int rowNumber,
java.lang.Object itemId) |
protected void |
createFonts() |
protected void |
createFormats() |
protected int |
createGroupRow(GroupTable table,
java.util.List<Table.Column> columns,
int rowNumber,
GroupInfo groupInfo,
int groupNumber) |
protected int |
createHierarhicalRow(TreeTable table,
java.util.List<Table.Column> columns,
java.lang.Boolean exportExpanded,
int rowNumber,
java.lang.Object itemId) |
protected java.util.function.Function<Entity,InstanceContainer<Entity>> |
createInstanceContainerProvider(DataGrid dataGrid,
Entity item) |
protected void |
createRow(Table table,
java.util.List<Table.Column> columns,
int startColumn,
int rowNumber,
java.lang.Object itemId) |
protected java.lang.String |
createSpaceString(int level) |
protected void |
createWorkbookWithSheet() |
void |
exportDataGrid(DataGrid<Entity> dataGrid,
java.util.List<DataGrid.Column> columns,
ExportDisplay display,
java.util.List<java.lang.String> filterDescription,
java.lang.String fileName,
ExcelExporter.ExportMode exportMode) |
void |
exportDataGrid(DataGrid dataGrid,
ExportDisplay display) |
void |
exportDataGrid(DataGrid dataGrid,
java.util.List<DataGrid.Column> columns,
ExportDisplay display) |
void |
exportDataGrid(DataGrid dataGrid,
java.util.List<DataGrid.Column> columns,
ExportDisplay display,
ExcelExporter.ExportMode exportMode) |
void |
exportDataGrid(DataGrid dataGrid,
java.util.List<DataGrid.Column> columns,
ExportDisplay display,
java.util.List<java.lang.String> filterDescription) |
void |
exportTable(Table<Entity> table,
java.util.List<Table.Column> columns,
java.lang.Boolean exportExpanded,
ExportDisplay display,
java.util.List<java.lang.String> filterDescription,
java.lang.String fileName,
ExcelExporter.ExportMode exportMode) |
void |
exportTable(Table table,
ExportDisplay display) |
void |
exportTable(Table table,
java.util.List<Table.Column> columns,
java.lang.Boolean exportExpanded,
ExportDisplay display) |
void |
exportTable(Table table,
java.util.List<Table.Column> columns,
java.lang.Boolean exportExpanded,
ExportDisplay display,
java.util.List<java.lang.String> filterDescription) |
void |
exportTable(Table table,
java.util.List<Table.Column> columns,
ExportDisplay display) |
void |
exportTable(Table table,
java.util.List<Table.Column> columns,
ExportDisplay display,
ExcelExporter.ExportMode exportMode) |
protected void |
formatValueCell(org.apache.poi.ss.usermodel.Cell cell,
java.lang.Object cellValue,
MetaPropertyPath metaPropertyPath,
int sizersIndex,
int notificationRequired,
int level,
java.lang.Integer groupChildCount) |
protected short |
getBuiltinFormat(java.lang.String format) |
boolean |
getExportAggregation() |
protected boolean |
hasAggregatableColumn(Table table)
Checks that at least one column in table is aggregatable.
|
protected void |
initExcelConfig(ExcelExportFormat excelExportFormat) |
boolean |
isXlsMaxRowNumberExceeded() |
void |
setExportAggregation(boolean exportAggregation) |
protected static final int COL_WIDTH_MAGIC
public static final int MAX_ROW_COUNT
protected org.apache.poi.ss.usermodel.Workbook wb
protected org.apache.poi.ss.usermodel.Font boldFont
protected org.apache.poi.ss.usermodel.Font stdFont
protected org.apache.poi.ss.usermodel.Sheet sheet
protected org.apache.poi.ss.usermodel.CellStyle timeFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle dateFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle dateTimeFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle integerFormatCellStyle
protected org.apache.poi.ss.usermodel.CellStyle doubleFormatCellStyle
protected ExcelAutoColumnSizer[] sizers
protected java.lang.String trueStr
protected java.lang.String falseStr
protected boolean exportAggregation
protected final Messages messages
protected final UserSessionSource userSessionSource
protected final MetadataTools metadataTools
protected boolean isRowNumberExceeded
protected ExcelExportHelper excelExportHelper
protected ExcelOptions excelOptions
public ExcelExporter()
public ExcelExporter(ExcelExportFormat excelExportFormat)
public void exportTable(Table table, @Nullable ExportDisplay display)
public void exportTable(Table table, java.util.List<Table.Column> columns, @Nullable ExportDisplay display, ExcelExporter.ExportMode exportMode)
protected void createWorkbookWithSheet()
protected void createFonts()
protected void createAutoColumnSizers(int count)
public void exportTable(Table table, java.util.List<Table.Column> columns, @Nullable ExportDisplay display)
public void exportTable(Table table, java.util.List<Table.Column> columns, java.lang.Boolean exportExpanded, @Nullable ExportDisplay display)
public void exportTable(Table table, java.util.List<Table.Column> columns, java.lang.Boolean exportExpanded, @Nullable ExportDisplay display, @Nullable java.util.List<java.lang.String> filterDescription)
public void exportTable(Table<Entity> table, java.util.List<Table.Column> columns, java.lang.Boolean exportExpanded, @Nullable ExportDisplay display, @Nullable java.util.List<java.lang.String> filterDescription, @Nullable java.lang.String fileName, ExcelExporter.ExportMode exportMode)
public void exportDataGrid(DataGrid dataGrid, @Nullable ExportDisplay display)
public void exportDataGrid(DataGrid dataGrid, java.util.List<DataGrid.Column> columns, @Nullable ExportDisplay display)
public void exportDataGrid(DataGrid dataGrid, java.util.List<DataGrid.Column> columns, @Nullable ExportDisplay display, ExcelExporter.ExportMode exportMode)
public void exportDataGrid(DataGrid dataGrid, java.util.List<DataGrid.Column> columns, @Nullable ExportDisplay display, @Nullable java.util.List<java.lang.String> filterDescription)
public void exportDataGrid(DataGrid<Entity> dataGrid, java.util.List<DataGrid.Column> columns, @Nullable ExportDisplay display, @Nullable java.util.List<java.lang.String> filterDescription, @Nullable java.lang.String fileName, ExcelExporter.ExportMode exportMode)
protected void createFormats()
protected int createHierarhicalRow(TreeTable table, java.util.List<Table.Column> columns, java.lang.Boolean exportExpanded, int rowNumber, java.lang.Object itemId)
protected int createAggregatableRow(Table table, java.util.List<Table.Column> columns, int rowNumber, int aggregatableRow)
protected int createGroupRow(GroupTable table, java.util.List<Table.Column> columns, int rowNumber, GroupInfo groupInfo, int groupNumber)
protected void createRow(Table table, java.util.List<Table.Column> columns, int startColumn, int rowNumber, java.lang.Object itemId)
protected int createDataGridHierarchicalRow(TreeDataGrid dataGrid, TreeDataGridItems<Entity> treeDataGridItems, java.util.List<DataGrid.Column> columns, int startColumn, int rowNumber, Entity item)
protected void createDataGridRow(DataGrid dataGrid, java.util.List<DataGrid.Column> columns, int startColumn, int rowNumber, java.lang.Object itemId)
protected java.util.function.Function<Entity,InstanceContainer<Entity>> createInstanceContainerProvider(DataGrid dataGrid, Entity item)
protected java.lang.String createSpaceString(int level)
protected void formatValueCell(org.apache.poi.ss.usermodel.Cell cell, @Nullable java.lang.Object cellValue, @Nullable MetaPropertyPath metaPropertyPath, int sizersIndex, int notificationRequired, int level, @Nullable java.lang.Integer groupChildCount)
protected boolean checkIsRowNumberExceed(int r)
public boolean isXlsMaxRowNumberExceeded()
public void setExportAggregation(boolean exportAggregation)
public boolean getExportAggregation()
protected boolean hasAggregatableColumn(Table table)
table
- tableprotected short getBuiltinFormat(java.lang.String format)
protected void initExcelConfig(ExcelExportFormat excelExportFormat)