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.hssf.usermodel.HSSFFont |
boldFont |
protected static int |
COL_WIDTH_MAGIC |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
dateFormatCellStyle |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
dateTimeFormatCellStyle |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
doubleFormatCellStyle |
protected boolean |
exportAggregation |
protected java.lang.String |
falseStr |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
integerFormatCellStyle |
protected boolean |
isRowNumberExceeded |
static int |
MAX_ROW_COUNT |
protected Messages |
messages |
protected MetadataTools |
metadataTools |
protected org.apache.poi.hssf.usermodel.HSSFSheet |
sheet |
protected ExcelAutoColumnSizer[] |
sizers |
protected org.apache.poi.hssf.usermodel.HSSFFont |
stdFont |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
timeFormatCellStyle |
protected java.lang.String |
trueStr |
protected UserSessionSource |
userSessionSource |
protected org.apache.poi.hssf.usermodel.HSSFWorkbook |
wb |
Constructor and Description |
---|
ExcelExporter() |
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 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.hssf.usermodel.HSSFCell cell,
java.lang.Object cellValue,
com.haulmont.chile.core.model.MetaPropertyPath metaPropertyPath,
int sizersIndex,
int notificationRequired,
int level,
java.lang.Integer groupChildCount) |
boolean |
getExportAggregation() |
protected boolean |
hasAggregatableColumn(Table table)
Checks that at least one column in table is aggregatable.
|
boolean |
isXlsMaxRowNumberExceeded() |
void |
setExportAggregation(boolean exportAggregation) |
protected static final int COL_WIDTH_MAGIC
public static final int MAX_ROW_COUNT
protected org.apache.poi.hssf.usermodel.HSSFWorkbook wb
protected org.apache.poi.hssf.usermodel.HSSFFont boldFont
protected org.apache.poi.hssf.usermodel.HSSFFont stdFont
protected org.apache.poi.hssf.usermodel.HSSFSheet sheet
protected org.apache.poi.hssf.usermodel.HSSFCellStyle timeFormatCellStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle dateFormatCellStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle dateTimeFormatCellStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle integerFormatCellStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle 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
public void exportTable(Table table, ExportDisplay display)
public void exportTable(Table table, java.util.List<Table.Column> columns, 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, ExportDisplay display)
public void exportTable(Table table, java.util.List<Table.Column> columns, java.lang.Boolean exportExpanded, ExportDisplay display)
public void exportTable(Table table, java.util.List<Table.Column> columns, java.lang.Boolean exportExpanded, ExportDisplay display, java.util.List<java.lang.String> filterDescription)
public 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)
public void exportDataGrid(DataGrid dataGrid, ExportDisplay display)
public void exportDataGrid(DataGrid dataGrid, java.util.List<DataGrid.Column> columns, ExportDisplay display)
public void exportDataGrid(DataGrid dataGrid, java.util.List<DataGrid.Column> columns, ExportDisplay display, ExcelExporter.ExportMode exportMode)
public void exportDataGrid(DataGrid dataGrid, java.util.List<DataGrid.Column> columns, ExportDisplay display, java.util.List<java.lang.String> filterDescription)
public 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)
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.lang.String createSpaceString(int level)
protected void formatValueCell(org.apache.poi.hssf.usermodel.HSSFCell cell, @Nullable java.lang.Object cellValue, @Nullable com.haulmont.chile.core.model.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
- table