Class FIXGRIDExcelExporter

java.lang.Object
org.eclnt.jsfserver.elements.util.FIXGRIDExcelExporter
All Implemented Interfaces:
Serializable, IFIXGRIDExcelExporter, IFIXGRIDSpreadSheetExporter

public class FIXGRIDExcelExporter extends Object implements Serializable, IFIXGRIDExcelExporter
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 Details

    • FIXGRIDExcelExporter

      public FIXGRIDExcelExporter()
  • Method Details

    • setGridTitle

      public void setGridTitle(String title)
      Description copied from interface: IFIXGRIDSpreadSheetExporter
      Setting of title text that is printed before the grid.
      Specified by:
      setGridTitle in interface IFIXGRIDSpreadSheetExporter
    • getGridTitle

      public String getGridTitle()
    • getColumnSizeFactor

      public float getColumnSizeFactor()
      Specified by:
      getColumnSizeFactor in interface IFIXGRIDSpreadSheetExporter
    • 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 interface IFIXGRIDSpreadSheetExporter
    • getMaxNumberOfGridRows

      public int getMaxNumberOfGridRows()
      Specified by:
      getMaxNumberOfGridRows in interface IFIXGRIDSpreadSheetExporter
    • setMaxNumberOfGridRows

      public void setMaxNumberOfGridRows(int maxNumberOfGridRows)
      Specified by:
      setMaxNumberOfGridRows in interface IFIXGRIDSpreadSheetExporter
    • setExportInfoProvider

      public void setExportInfoProvider(IFIXGRIDExportInfoProvider exportInfoProvider)
      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 interface IFIXGRIDSpreadSheetExporter
    • 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 interface IFIXGRIDSpreadSheetExporter
    • 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)
    • createBeforeFooter

      protected void createBeforeFooter(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid)
    • createAfterFooter

      protected void createAfterFooter(org.apache.poi.xssf.usermodel.XSSFWorkbook wb, org.apache.poi.ss.usermodel.Sheet sheet, FIXGRIDBinding fixgrid)
    • createFooterRows

      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)
    • 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

      protected String findFontForDataCell(int rowIndex, Object dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
    • 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

      protected String convertNumericFormatMaskToExcelFormat(String format, String formatMask)
      Creates data format that is used in Excel.
    • passCellValue

      protected void passCellValue(org.apache.poi.ss.usermodel.Cell cell, Object value, String valueText, String format)
    • calculateColumnWidth

      protected int calculateColumnWidth(org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo ci)
      Calculation of column width.
    • objectToString

      protected String objectToString(String s)