Package io.jmix.pivottableflowui.export
Class PivotTableExcelExporter
java.lang.Object
io.jmix.pivottableflowui.export.PivotTableExcelExporter
@Component("pvttbl_PivotTableExcelExporter")
@Scope("prototype")
public class PivotTableExcelExporter
extends Object
Exports 
PivotData to XLS file.- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected org.apache.poi.ss.usermodel.CellStyleprotected static final intCAUTION Magic number! This multiplier is used for calculating column width.protected CorePropertiesprotected CurrentAuthenticationprotected DatatypeRegistryprotected SimpleDateFormatprotected Stringprotected SimpleDateFormatprotected Stringstatic final Stringprotected Downloaderprotected MetaClassprotected PivotTableExcelExporter.ExportFormatprotected Stringstatic final intprotected Messagesprotected MessageToolsprotected Notificationsprotected org.apache.poi.ss.usermodel.Sheetprotected org.apache.poi.ss.usermodel.Fontprotected SimpleDateFormatprotected Stringprotected UiPropertiesprotected org.apache.poi.ss.usermodel.Workbook
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidprotected voidcreateRows(PivotData pivotData) protected voidprotected voidexport(Downloader downloader) voidexportPivotTable(PivotData pivotData, String fileName) Exports pivot table data to the Excel file.voidexportPivotTable(PivotData pivotData, String fileName, Downloader downloader) Exports pivot table data to the Excel file.protected shortgetBuiltinFormat(String format) voidinit(PivotTable<?> pivotTable) protected voidinitCell(org.apache.poi.ss.usermodel.Cell excelCell, PivotDataSeparatedCell cell) protected voidinitDateTimeCell(org.apache.poi.ss.usermodel.Cell excelCell, PivotDataSeparatedCell cell, SimpleDateFormat formatter, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.CellStyle boldCellStyle) protected booleanisPivotDataEmpty(PivotData pivotData) booleanisXlsMaxRowNumberExceeded(PivotData pivotData) voidsetDateParseFormat(String dateParseFormat) Sets date format that will be used to finding dateTime value and exporting it to excel with date type.voidsetDateTimeParseFormat(String dateTimeParseFormat) Sets dateTime format that will be used to finding dateTime value and exporting it to excel with dateTime type.voidsetDownloader(Downloader downloader) voidsetExportFormat(PivotTableExcelExporter.ExportFormat exportFormat) Sets export formatXLSorXLSX.voidsetMessages(Messages messages) voidsetTimeParseFormat(String timeParseFormat) Sets date format that will be used to finding dateTime value and exporting it to excel with date type.protected voidprotected voidprotected voidupdateColumnSize(ExcelAutoColumnSizer[] sizers, PivotDataSeparatedCell cell) 
- 
Field Details- 
MAX_ROW_INDEXpublic static final int MAX_ROW_INDEX- See Also:
 
- 
COLUMN_WIDTH_MULTIPLIERprotected static final int COLUMN_WIDTH_MULTIPLIERCAUTION Magic number! This multiplier is used for calculating column width. Without this multiplier all columns in the file will be collapsed.- See Also:
 
- 
DEFAULT_FILE_NAME- See Also:
 
- 
exportFormat
- 
wbprotected org.apache.poi.ss.usermodel.Workbook wb
- 
sheetprotected org.apache.poi.ss.usermodel.Sheet sheet
- 
stdFontprotected org.apache.poi.ss.usermodel.Font stdFont
- 
cellLabelBoldStyleprotected org.apache.poi.ss.usermodel.CellStyle cellLabelBoldStyle
- 
cellDateTimeStyleprotected org.apache.poi.ss.usermodel.CellStyle cellDateTimeStyle
- 
boldCellDateTimeStyleprotected org.apache.poi.ss.usermodel.CellStyle boldCellDateTimeStyle
- 
cellDateStyleprotected org.apache.poi.ss.usermodel.CellStyle cellDateStyle
- 
boldCellDateStyleprotected org.apache.poi.ss.usermodel.CellStyle boldCellDateStyle
- 
cellTimeStyleprotected org.apache.poi.ss.usermodel.CellStyle cellTimeStyle
- 
boldCellTimeStyleprotected org.apache.poi.ss.usermodel.CellStyle boldCellTimeStyle
- 
cellIntegerStyleprotected org.apache.poi.ss.usermodel.CellStyle cellIntegerStyle
- 
boldCellIntegerStyleprotected org.apache.poi.ss.usermodel.CellStyle boldCellIntegerStyle
- 
cellDoubleStyleprotected org.apache.poi.ss.usermodel.CellStyle cellDoubleStyle
- 
boldCellDoubleStyleprotected org.apache.poi.ss.usermodel.CellStyle boldCellDoubleStyle
- 
fileName
- 
entityMetaClass
- 
messages
- 
downloader
- 
dateTimeParseFormat
- 
dateTimeFormatter
- 
dateParseFormat
- 
dateFormatter
- 
timeParseFormat
- 
timeFormatter
- 
notifications
- 
coreProperties
- 
uiProperties
- 
messageTools
- 
datatypeRegistry
- 
currentAuthentication
 
- 
- 
Constructor Details- 
PivotTableExcelExporterpublic PivotTableExcelExporter()
- 
PivotTableExcelExporter
 
- 
- 
Method Details- 
setMessages
- 
setDownloader
- 
init
- 
exportPivotTableExports pivot table data to the Excel file. File format can be configured bysetExportFormat(ExportFormat).- Parameters:
- pivotData- pivot with aggregated data
- fileName- file name
 
- 
exportPivotTableExports pivot table data to the Excel file. File format can be configured bysetExportFormat(ExportFormat).- Parameters:
- pivotData- pivot with aggregated data
- fileName- file name
- downloader- Downloader implementation
 
- 
createRows
- 
initCell
- 
updateColumnSize
- 
initDateTimeCellprotected void initDateTimeCell(org.apache.poi.ss.usermodel.Cell excelCell, PivotDataSeparatedCell cell, @Nullable SimpleDateFormat formatter, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.CellStyle boldCellStyle) 
- 
createWorkbookWithSheetprotected void createWorkbookWithSheet()
- 
createCellsStyleprotected void createCellsStyle()
- 
getBuiltinFormat
- 
showWarnNotificationprotected void showWarnNotification()
- 
export
- 
showNoDataWarningprotected void showNoDataWarning()
- 
isPivotDataEmpty
- 
isXlsMaxRowNumberExceeded- Parameters:
- pivotData- pivot with aggregated data
- Returns:
- true if exported table contains more than 65536 records
 
- 
getDateTimeParseFormat- Returns:
- dateTime format or null
 
- 
setDateTimeParseFormatSets dateTime format that will be used to finding dateTime value and exporting it to excel with dateTime type.- Parameters:
- dateTimeParseFormat- dateTime format (e.g. dd/MM/yyyy HH:mm)
 
- 
getDateParseFormat- Returns:
- date format or null
 
- 
setDateParseFormatSets date format that will be used to finding dateTime value and exporting it to excel with date type. If there is no format set, date properties will be recognized as text value.- Parameters:
- dateParseFormat- date format (e.g. dd/MM/yyyy)
 
- 
getTimeParseFormat- Returns:
- time format or null
 
- 
setTimeParseFormatSets date format that will be used to finding dateTime value and exporting it to excel with date type. If there is no format set, time properties will be recognized as text value.- Parameters:
- timeParseFormat- time format (e.g. HH:mm)
 
- 
getExportFormat- Returns:
- export format XLSorXLSX
 
- 
setExportFormatSets export formatXLSorXLSX. The default value isXLSX.- Parameters:
- exportFormat- format that should have exported file
 
 
-