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 void
applyTitleStyle
(org.apache.poi.ss.usermodel.CellStyle titleStyle, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) 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) protected int
calculateColumnWidth
(org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo ci) Calculation of column width.protected String
convertNumericFormatMaskToExcelFormat
(String format, String formatMask) Creates data format that is used in Excel.protected void
createAfterFooter
(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) protected void
createAfterHeader
(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) protected void
createBeforeFooter
(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid) protected void
createBeforeHeader
(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 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) protected void
createFooterRows
(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.XSSFFont
createHeaderFont
(org.apache.poi.xssf.usermodel.XSSFWorkbook wb) 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) 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) protected void
createMaxNumberReachedRow
(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, int rowSize) protected org.apache.poi.ss.usermodel.Row
createRow
(org.apache.poi.ss.usermodel.Sheet sheet) protected org.apache.poi.ss.usermodel.Sheet
createSheet
(org.apache.poi.xssf.usermodel.XSSFWorkbook wb) protected org.apache.poi.xssf.usermodel.XSSFWorkbook
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) 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 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) protected void
feedCellAlignment
(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo columnInfo) 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.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.protected String
findFontForDataCell
(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) 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.float
int
protected String
protected void
passCellValue
(org.apache.poi.ss.usermodel.Cell cell, Object value, String valueText, String format) protected void
rowFeed()
void
setColumnSizeFactor
(float columnSizeFactor) There is a calculation of column widths which is based in the width definition inside the FIXGRID component.void
setExportInfoProvider
(IFIXGRIDExportInfoProvider exportInfoProvider) Optional call back interface which allows the exporter to get more information about individual data rows/cells.void
setGridTitle
(String title) Setting of title text that is printed before the grid.void
setMaxNumberOfGridRows
(int maxNumberOfGridRows)
-
Constructor Details
-
FIXGRIDExcelExporter
public FIXGRIDExcelExporter()
-
-
Method Details
-
setGridTitle
Description copied from interface:IFIXGRIDSpreadSheetExporter
Setting of title text that is printed before the grid.- Specified by:
setGridTitle
in interfaceIFIXGRIDSpreadSheetExporter
-
getGridTitle
-
getColumnSizeFactor
public float getColumnSizeFactor()- Specified by:
getColumnSizeFactor
in interfaceIFIXGRIDSpreadSheetExporter
-
setColumnSizeFactor
public void setColumnSizeFactor(float columnSizeFactor) Description copied from interface:IFIXGRIDSpreadSheetExporter
There 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:
setColumnSizeFactor
in interfaceIFIXGRIDSpreadSheetExporter
-
getMaxNumberOfGridRows
public int getMaxNumberOfGridRows()- Specified by:
getMaxNumberOfGridRows
in interfaceIFIXGRIDSpreadSheetExporter
-
setMaxNumberOfGridRows
public void setMaxNumberOfGridRows(int maxNumberOfGridRows) - Specified by:
setMaxNumberOfGridRows
in interfaceIFIXGRIDSpreadSheetExporter
-
setExportInfoProvider
Description copied from interface:IFIXGRIDSpreadSheetExporter
Optional call back interface which allows the exporter to get more information about individual data rows/cells.- Specified by:
setExportInfoProvider
in 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:
exportGrid
in 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
-