@Component(value="ui_PivotExcelExporter")
@Scope(value="prototype")
public class PivotExcelExporter
extends java.lang.Object
PivotData
to XLS file.Modifier and Type | Class and Description |
---|---|
static class |
PivotExcelExporter.ExportFormat |
Modifier and Type | Field and Description |
---|---|
protected org.apache.poi.ss.usermodel.CellStyle |
boldCellDateStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
boldCellDateTimeStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
boldCellDoubleStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
boldCellIntegerStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
boldCellTimeStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
cellDateStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
cellDateTimeStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
cellDoubleStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
cellIntegerStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
cellLabelBoldStyle |
protected org.apache.poi.ss.usermodel.CellStyle |
cellTimeStyle |
protected static int |
COLUMN_WIDTH_MULTIPLIER
CAUTION Magic number! This multiplier is used for calculating column width.
|
protected io.jmix.core.CoreProperties |
coreProperties |
protected io.jmix.core.security.CurrentAuthentication |
currentAuthentication |
protected io.jmix.core.metamodel.datatype.DatatypeRegistry |
datatypeRegistry |
protected java.text.SimpleDateFormat |
dateFormatter |
protected java.lang.String |
dateParseFormat |
protected java.text.SimpleDateFormat |
dateTimeFormatter |
protected java.lang.String |
dateTimeParseFormat |
static java.lang.String |
DEFAULT_FILE_NAME |
protected Downloader |
downloader |
protected io.jmix.core.metamodel.model.MetaClass |
entityMetaClass |
protected PivotExcelExporter.ExportFormat |
exportFormat |
protected java.lang.String |
fileName |
static int |
MAX_ROW_INDEX |
protected io.jmix.core.Messages |
messages |
protected io.jmix.core.MessageTools |
messageTools |
protected Notifications |
notifications |
protected org.apache.poi.ss.usermodel.Sheet |
sheet |
protected org.apache.poi.ss.usermodel.Font |
stdFont |
protected java.text.SimpleDateFormat |
timeFormatter |
protected java.lang.String |
timeParseFormat |
protected UiProperties |
uiProperties |
protected org.apache.poi.ss.usermodel.Workbook |
wb |
Constructor and Description |
---|
PivotExcelExporter() |
PivotExcelExporter(PivotTable pivotTable) |
Modifier and Type | Method and Description |
---|---|
protected void |
createCellsStyle() |
protected void |
createRows(PivotData pivotData) |
protected void |
createWorkbookWithSheet() |
protected void |
export(Downloader downloader) |
void |
exportPivotTable(PivotData pivotData,
java.lang.String fileName)
Exports pivot table data to the excel file.
|
void |
exportPivotTable(PivotData pivotData,
java.lang.String fileName,
Downloader downloader)
Exports pivot table data to the excel file.
|
protected short |
getBuiltinFormat(java.lang.String format) |
java.lang.String |
getDateParseFormat() |
java.lang.String |
getDateTimeParseFormat() |
PivotExcelExporter.ExportFormat |
getExportFormat() |
java.lang.String |
getTimeParseFormat() |
void |
init(PivotTable pivotTable) |
protected void |
initCell(org.apache.poi.ss.usermodel.Cell excelCell,
PivotDataSeparatedCell cell) |
protected void |
initDateTimeCell(org.apache.poi.ss.usermodel.Cell excelCell,
PivotDataSeparatedCell cell,
java.text.SimpleDateFormat formatter,
org.apache.poi.ss.usermodel.CellStyle cellStyle,
org.apache.poi.ss.usermodel.CellStyle boldCellStyle) |
protected void |
initNotifications(PivotTable pivotTable) |
protected boolean |
isPivotDataEmpty(PivotData pivotData) |
boolean |
isXlsMaxRowNumberExceeded(PivotData pivotData) |
void |
setDateParseFormat(java.lang.String dateParseFormat)
Sets date format that will be used to finding dateTime value and exporting it to excel with date type.
|
void |
setDateTimeParseFormat(java.lang.String dateTimeParseFormat)
Sets dateTime format that will be used to finding dateTime value and exporting it to excel with dateTime type.
|
void |
setDownloader(Downloader downloader) |
void |
setExportFormat(PivotExcelExporter.ExportFormat exportFormat)
Sets export format
XLS or XLSX . |
void |
setMessages(io.jmix.core.Messages messages) |
void |
setTimeParseFormat(java.lang.String timeParseFormat)
Sets date format that will be used to finding dateTime value and exporting it to excel with date type.
|
protected void |
showNoDataWarning() |
protected void |
showWarnNotification() |
protected void |
updateColumnSize(ExcelAutoColumnSizer[] sizers,
PivotDataSeparatedCell cell) |
public static final int MAX_ROW_INDEX
protected static final int COLUMN_WIDTH_MULTIPLIER
public static final java.lang.String DEFAULT_FILE_NAME
protected PivotExcelExporter.ExportFormat exportFormat
protected org.apache.poi.ss.usermodel.Workbook wb
protected org.apache.poi.ss.usermodel.Sheet sheet
protected org.apache.poi.ss.usermodel.Font stdFont
protected org.apache.poi.ss.usermodel.CellStyle cellLabelBoldStyle
protected org.apache.poi.ss.usermodel.CellStyle cellDateTimeStyle
protected org.apache.poi.ss.usermodel.CellStyle boldCellDateTimeStyle
protected org.apache.poi.ss.usermodel.CellStyle cellDateStyle
protected org.apache.poi.ss.usermodel.CellStyle boldCellDateStyle
protected org.apache.poi.ss.usermodel.CellStyle cellTimeStyle
protected org.apache.poi.ss.usermodel.CellStyle boldCellTimeStyle
protected org.apache.poi.ss.usermodel.CellStyle cellIntegerStyle
protected org.apache.poi.ss.usermodel.CellStyle boldCellIntegerStyle
protected org.apache.poi.ss.usermodel.CellStyle cellDoubleStyle
protected org.apache.poi.ss.usermodel.CellStyle boldCellDoubleStyle
protected java.lang.String fileName
protected io.jmix.core.metamodel.model.MetaClass entityMetaClass
protected io.jmix.core.Messages messages
protected Downloader downloader
protected java.lang.String dateTimeParseFormat
protected java.text.SimpleDateFormat dateTimeFormatter
protected java.lang.String dateParseFormat
protected java.text.SimpleDateFormat dateFormatter
protected java.lang.String timeParseFormat
protected java.text.SimpleDateFormat timeFormatter
protected Notifications notifications
@Autowired protected io.jmix.core.CoreProperties coreProperties
@Autowired protected UiProperties uiProperties
@Autowired protected io.jmix.core.MessageTools messageTools
@Autowired protected io.jmix.core.metamodel.datatype.DatatypeRegistry datatypeRegistry
@Autowired protected io.jmix.core.security.CurrentAuthentication currentAuthentication
public PivotExcelExporter(PivotTable pivotTable)
public PivotExcelExporter()
public void init(PivotTable pivotTable)
@Autowired public void setMessages(io.jmix.core.Messages messages)
@Autowired public void setDownloader(Downloader downloader)
protected void initNotifications(PivotTable pivotTable)
public void exportPivotTable(PivotData pivotData, java.lang.String fileName)
setExportFormat(ExportFormat)
.pivotData
- pivot with aggregated datafileName
- file namepublic void exportPivotTable(PivotData pivotData, java.lang.String fileName, Downloader downloader)
setExportFormat(ExportFormat)
.pivotData
- pivot with aggregated datafileName
- file namedownloader
- Downloader implementationprotected void createRows(PivotData pivotData)
protected void initCell(org.apache.poi.ss.usermodel.Cell excelCell, PivotDataSeparatedCell cell)
protected void updateColumnSize(ExcelAutoColumnSizer[] sizers, PivotDataSeparatedCell cell)
protected void initDateTimeCell(org.apache.poi.ss.usermodel.Cell excelCell, PivotDataSeparatedCell cell, java.text.SimpleDateFormat formatter, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.CellStyle boldCellStyle)
protected void createWorkbookWithSheet()
protected void createCellsStyle()
protected short getBuiltinFormat(java.lang.String format)
protected void showWarnNotification()
protected void export(Downloader downloader)
protected void showNoDataWarning()
protected boolean isPivotDataEmpty(PivotData pivotData)
public boolean isXlsMaxRowNumberExceeded(PivotData pivotData)
pivotData
- pivot with aggregated data@Nullable public java.lang.String getDateTimeParseFormat()
public void setDateTimeParseFormat(java.lang.String dateTimeParseFormat)
dateTimeParseFormat
- dateTime format (e.g. dd/MM/yyyy HH:mm)@Nullable public java.lang.String getDateParseFormat()
public void setDateParseFormat(java.lang.String dateParseFormat)
dateParseFormat
- date format (e.g. dd/MM/yyyy)@Nullable public java.lang.String getTimeParseFormat()
public void setTimeParseFormat(java.lang.String timeParseFormat)
timeParseFormat
- time format (e.g. HH:mm)public PivotExcelExporter.ExportFormat getExportFormat()
XLS
or XLSX
public void setExportFormat(PivotExcelExporter.ExportFormat exportFormat)
XLS
or XLSX
. The default value is XLSX
.exportFormat
- format that should have exported file