@Component(value="ui_PivotExcelExporter")
@Scope(value="prototype")
public class PivotExcelExporter
extends java.lang.Object
PivotData
to XLS file.Modifier and Type | Field and Description |
---|---|
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
boldCellDateStyle |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
boldCellDateTimeStyle |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
boldCellTimeStyle |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
cellDateStyle |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
cellDateTimeStyle |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
cellLabelBoldStyle |
protected org.apache.poi.hssf.usermodel.HSSFCellStyle |
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 java.lang.String |
dateParseFormat |
protected java.lang.String |
dateTimeParseFormat |
static java.lang.String |
DEFAULT_FILE_NAME |
protected Downloader |
downloader |
protected io.jmix.core.metamodel.model.MetaClass |
entityMetaClass |
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.hssf.usermodel.HSSFSheet |
sheet |
protected org.apache.poi.hssf.usermodel.HSSFFont |
stdFont |
protected java.lang.String |
timeParseFormat |
protected UiProperties |
uiProperties |
protected org.apache.poi.hssf.usermodel.HSSFWorkbook |
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)
Export to Xls.
|
void |
exportPivotTable(PivotData pivotData,
java.lang.String fileName,
Downloader downloader)
Export to Xls.
|
java.lang.String |
getDateParseFormat() |
java.lang.String |
getDateTimeParseFormat() |
java.lang.String |
getTimeParseFormat() |
void |
init(PivotTable pivotTable) |
protected void |
initDateTimeCell(org.apache.poi.hssf.usermodel.HSSFCell hssfCell,
PivotDataSeparatedCell cell,
java.text.SimpleDateFormat formatter,
org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyle,
org.apache.poi.hssf.usermodel.HSSFCellStyle 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 |
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 org.apache.poi.hssf.usermodel.HSSFWorkbook wb
protected org.apache.poi.hssf.usermodel.HSSFSheet sheet
protected org.apache.poi.hssf.usermodel.HSSFFont stdFont
protected org.apache.poi.hssf.usermodel.HSSFCellStyle cellLabelBoldStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle cellDateTimeStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle boldCellDateTimeStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle cellDateStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle boldCellDateStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle cellTimeStyle
protected org.apache.poi.hssf.usermodel.HSSFCellStyle boldCellTimeStyle
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.lang.String dateParseFormat
protected java.lang.String timeParseFormat
protected Notifications notifications
@Autowired protected io.jmix.core.CoreProperties coreProperties
@Autowired protected UiProperties uiProperties
@Autowired protected io.jmix.core.MessageTools messageTools
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)
pivotData
- pivot with aggregated datafileName
- file namepublic void exportPivotTable(PivotData pivotData, java.lang.String fileName, Downloader downloader)
pivotData
- pivot with aggregated datafileName
- file namedownloader
- ExportDisplay implementationprotected void createRows(PivotData pivotData)
protected void updateColumnSize(ExcelAutoColumnSizer[] sizers, PivotDataSeparatedCell cell)
protected void initDateTimeCell(org.apache.poi.hssf.usermodel.HSSFCell hssfCell, PivotDataSeparatedCell cell, java.text.SimpleDateFormat formatter, org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyle, org.apache.poi.hssf.usermodel.HSSFCellStyle boldCellStyle)
protected void createWorkbookWithSheet()
protected void createCellsStyle()
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)