Class FIXGRIDExcelExporter
java.lang.Object
org.eclnt.jsfserver.elements.util.FIXGRIDExcelExporter
- All Implemented Interfaces:
Serializable,IFIXGRIDExcelExporter,IFIXGRIDSpreadSheetExporter
Export of grid content into XML. The grid's exporter creates an instance
of this class and calls it via the
#exportGridToXMLSpreadSheet(FIXGRIDBinding, List, List, boolean) method.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyTitleStyle(org.apache.poi.ss.usermodel.CellStyle titleStyle, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) protected voidbuildRow(Map<String, org.apache.poi.xssf.usermodel.XSSFCellStyle> bufferCellStyles, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.CreationHelper creationHelper, org.apache.poi.ss.usermodel.Row sheetRow, int dataRowIndex, List<FIXGRIDBinding.FormattedValue> row) protected intcalculateColumnWidth(org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo ci) Calculation of column width.protected StringconvertNumericFormatMaskToExcelFormat(String format, String formatMask) Creates data format that is used in Excel.protected voidcreateAfterFooter(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) protected voidcreateAfterHeader(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) protected voidcreateBeforeFooter(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) protected voidcreateBeforeHeader(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) protected List<org.apache.poi.ss.usermodel.CellStyle>createColumnTitleCellStyles(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<FIXGRIDBinding.FormattedValue>> data) protected voidcreateDataRows(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<List<FIXGRIDBinding.FormattedValue>> data, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, Map<String, org.apache.poi.xssf.usermodel.XSSFCellStyle> bufferCellStyles) protected voidcreateFooterRows(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<org.apache.poi.ss.usermodel.CellStyle> columnTitleCellStyles, List<List<FIXGRIDBinding.FormattedValue>> footerRows) protected org.apache.poi.xssf.usermodel.XSSFFontcreateHeaderFont(org.apache.poi.xssf.usermodel.XSSFWorkbook wb) protected voidcreateHeaderRow(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<org.apache.poi.ss.usermodel.CellStyle> columnTitleCellStyles, List<FIXGRIDBinding.FormattedValue> row) protected voidcreateHeaderRows(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<org.apache.poi.ss.usermodel.CellStyle> columnTitleCellStyles, List<List<FIXGRIDBinding.FormattedValue>> headerRows) protected voidcreateMaxNumberReachedRow(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, int rowSize) protected org.apache.poi.ss.usermodel.RowcreateRow(org.apache.poi.ss.usermodel.Sheet sheet) protected org.apache.poi.ss.usermodel.SheetcreateSheet(org.apache.poi.xssf.usermodel.XSSFWorkbook wb) protected org.apache.poi.xssf.usermodel.XSSFWorkbookprotected voiddefineCellFormat(org.apache.poi.ss.usermodel.Workbook wb, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) byte[]exportGrid(FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<FIXGRIDBinding.FormattedValue>> data, boolean selctedItemsOnly) Main method for exporting.protected voidfeedCell(org.apache.poi.ss.usermodel.Workbook wb, org.apache.poi.ss.usermodel.Cell cell, FIXGRIDBinding.FormattedValue value, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) protected voidfeedCellAlignment(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) protected StringfindAlignmentForDataCell(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected StringfindBackgroundColorForDataCell(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected StringfindFontForDataCell(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) protected StringfindTextColorForDataCell(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.floatintprotected Stringprotected voidpassCellValue(org.apache.poi.ss.usermodel.Cell cell, Object value, String valueText, String format) protected voidrowFeed()voidsetColumnSizeFactor(float columnSizeFactor) There is a calculation of column widths which is based in the width definition inside the FIXGRID component.voidsetExportInfoProvider(IFIXGRIDExportInfoProvider exportInfoProvider) Optional call back interface which allows the exporter to get more information about individual data rows/cells.voidsetGridTitle(String title) Setting of title text that is printed before the grid.voidsetMaxNumberOfGridRows(int maxNumberOfGridRows)
-
Constructor Details
-
FIXGRIDExcelExporter
public FIXGRIDExcelExporter()
-
-
Method Details
-
setGridTitle
Description copied from interface:IFIXGRIDSpreadSheetExporterSetting of title text that is printed before the grid.- Specified by:
setGridTitlein interfaceIFIXGRIDSpreadSheetExporter
-
getGridTitle
-
getColumnSizeFactor
public float getColumnSizeFactor()- Specified by:
getColumnSizeFactorin interfaceIFIXGRIDSpreadSheetExporter
-
setColumnSizeFactor
public void setColumnSizeFactor(float columnSizeFactor) Description copied from interface:IFIXGRIDSpreadSheetExporterThere is a calculation of column widths which is based in the width definition inside the FIXGRID component. You can influence this calculation by assigning a factor. The calculated width is multiplied with the factor after calculation. The default value of the factor is 1f representing "100%".- Specified by:
setColumnSizeFactorin interfaceIFIXGRIDSpreadSheetExporter
-
getMaxNumberOfGridRows
public int getMaxNumberOfGridRows()- Specified by:
getMaxNumberOfGridRowsin interfaceIFIXGRIDSpreadSheetExporter
-
setMaxNumberOfGridRows
public void setMaxNumberOfGridRows(int maxNumberOfGridRows) - Specified by:
setMaxNumberOfGridRowsin interfaceIFIXGRIDSpreadSheetExporter
-
setExportInfoProvider
Description copied from interface:IFIXGRIDSpreadSheetExporterOptional call back interface which allows the exporter to get more information about individual data rows/cells.- Specified by:
setExportInfoProviderin interfaceIFIXGRIDSpreadSheetExporter
-
exportGrid
public byte[] exportGrid(FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<FIXGRIDBinding.FormattedValue>> data, boolean selctedItemsOnly) Main method for exporting.- Specified by:
exportGridin interfaceIFIXGRIDSpreadSheetExporter
-
createColumnTitleCellStyles
protected List<org.apache.poi.ss.usermodel.CellStyle> createColumnTitleCellStyles(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<FIXGRIDBinding.FormattedValue>> data) -
createBeforeHeader
protected void createBeforeHeader(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) -
createAfterHeader
protected void createAfterHeader(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) -
createRow
protected org.apache.poi.ss.usermodel.Row createRow(org.apache.poi.ss.usermodel.Sheet sheet) -
createDataRows
protected void createDataRows(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<List<FIXGRIDBinding.FormattedValue>> data, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, Map<String, org.apache.poi.xssf.usermodel.XSSFCellStyle> bufferCellStyles) -
createMaxNumberReachedRow
protected void createMaxNumberReachedRow(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, int rowSize) -
rowFeed
protected void rowFeed() -
createHeaderRows
protected void createHeaderRows(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<org.apache.poi.ss.usermodel.CellStyle> columnTitleCellStyles, List<List<FIXGRIDBinding.FormattedValue>> headerRows) -
createHeaderRow
protected void createHeaderRow(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, List<org.apache.poi.ss.usermodel.CellStyle> columnTitleCellStyles, List<FIXGRIDBinding.FormattedValue> row) -
applyTitleStyle
protected void applyTitleStyle(org.apache.poi.ss.usermodel.CellStyle titleStyle, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) -
createHeaderFont
protected org.apache.poi.xssf.usermodel.XSSFFont createHeaderFont(org.apache.poi.xssf.usermodel.XSSFWorkbook wb) -
createXSSFWorkbook
protected org.apache.poi.xssf.usermodel.XSSFWorkbook createXSSFWorkbook() -
createSheet
protected org.apache.poi.ss.usermodel.Sheet createSheet(org.apache.poi.xssf.usermodel.XSSFWorkbook wb) -
buildRow
protected void buildRow(Map<String, org.apache.poi.xssf.usermodel.XSSFCellStyle> bufferCellStyles, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.CreationHelper creationHelper, org.apache.poi.ss.usermodel.Row sheetRow, int dataRowIndex, List<FIXGRIDBinding.FormattedValue> row) -
findAlignmentForDataCell
protected String findAlignmentForDataCell(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findBackgroundColorForDataCell
protected String findBackgroundColorForDataCell(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findTextColorForDataCell
protected String findTextColorForDataCell(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findFontForDataCell
-
feedCellAlignment
protected void feedCellAlignment(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) -
feedCell
protected void feedCell(org.apache.poi.ss.usermodel.Workbook wb, org.apache.poi.ss.usermodel.Cell cell, FIXGRIDBinding.FormattedValue value, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) -
defineCellFormat
protected void defineCellFormat(org.apache.poi.ss.usermodel.Workbook wb, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) -
convertNumericFormatMaskToExcelFormat
Creates data format that is used in Excel. -
passCellValue
-
calculateColumnWidth
protected int calculateColumnWidth(org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo ci) Calculation of column width. -
objectToString
-