Class FIXGRIDPDFExporter

java.lang.Object
org.eclnt.jsfserver.elements.util.FIXGRIDPDFExporter
All Implemented Interfaces:
Serializable, IFIXGRIDPdfExporter

public class FIXGRIDPDFExporter extends Object implements IFIXGRIDPdfExporter, Serializable
Export of grid content into PDF. The grid's exporter creates an instance of this class and calls it via the exportGridToPdf(FIXGRIDBinding, List, List, boolean) method.
See Also:
  • Field Details

    • FONT_TITLE

      public static com.lowagie.text.Font FONT_TITLE
    • FONT_HEADLINE

      public static com.lowagie.text.Font FONT_HEADLINE
    • FONT_FOOTERLINE

      public static com.lowagie.text.Font FONT_FOOTERLINE
    • FONT_DATALINE

      public static com.lowagie.text.Font FONT_DATALINE
    • COLOR_HEADLINE

      public static Color COLOR_HEADLINE
    • COLOR_FOOTERLINE

      public static Color COLOR_FOOTERLINE
    • COLOR_LIGHTROW

      public static Color COLOR_LIGHTROW
    • COLOR_DARKROW

      public static Color COLOR_DARKROW
  • Constructor Details

    • FIXGRIDPDFExporter

      public FIXGRIDPDFExporter()
  • Method Details

    • initPageSize

      public void initPageSize(float width, float height)
      Description copied from interface: IFIXGRIDPdfExporter
      Explicit definition of page size. If not called then DIN A4 will be used as page size.
      Specified by:
      initPageSize in interface IFIXGRIDPdfExporter
    • setFontTitle

      public void setFontTitle(com.lowagie.text.Font value)
      Specified by:
      setFontTitle in interface IFIXGRIDPdfExporter
    • setFontHeadline

      public void setFontHeadline(com.lowagie.text.Font value)
      Specified by:
      setFontHeadline in interface IFIXGRIDPdfExporter
    • setFontFooterline

      public void setFontFooterline(com.lowagie.text.Font value)
      Specified by:
      setFontFooterline in interface IFIXGRIDPdfExporter
    • setFontDataline

      public void setFontDataline(com.lowagie.text.Font value)
      Specified by:
      setFontDataline in interface IFIXGRIDPdfExporter
    • setColorHeadline

      public void setColorHeadline(Color value)
    • setColorFooterline

      public void setColorFooterline(Color value)
    • setColorLightRow

      public void setColorLightRow(Color value)
    • setColorDarkRow

      public void setColorDarkRow(Color value)
    • setFontselectorTitle

      public void setFontselectorTitle(com.lowagie.text.pdf.FontSelector value)
      Specified by:
      setFontselectorTitle in interface IFIXGRIDPdfExporter
    • setFontselectorHeadline

      public void setFontselectorHeadline(com.lowagie.text.pdf.FontSelector value)
      Specified by:
      setFontselectorHeadline in interface IFIXGRIDPdfExporter
    • setFontselectorFooterline

      public void setFontselectorFooterline(com.lowagie.text.pdf.FontSelector value)
      Specified by:
      setFontselectorFooterline in interface IFIXGRIDPdfExporter
    • setFontselectorDataline

      public void setFontselectorDataline(com.lowagie.text.pdf.FontSelector value)
      Specified by:
      setFontselectorDataline in interface IFIXGRIDPdfExporter
    • setGridTitle

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

      public String getGridTitle()
    • setColumnSizeFactor

      public void setColumnSizeFactor(float columnSizeFactor)
      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 IFIXGRIDPdfExporter
    • getColumnSizeFactor

      public float getColumnSizeFactor()
      Specified by:
      getColumnSizeFactor in interface IFIXGRIDPdfExporter
    • setExportInfoProvider

      public void setExportInfoProvider(IFIXGRIDExportInfoProvider exportInfoProvider)
      Description copied from interface: IFIXGRIDPdfExporter
      Optional call back interface which allows the exporter to get more information about individual data rows/cells.
      Specified by:
      setExportInfoProvider in interface IFIXGRIDPdfExporter
    • exportGridToPdf

      public byte[] exportGridToPdf(FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data, boolean selctedItemsOnly)
      Main method for exporting.
      Specified by:
      exportGridToPdf in interface IFIXGRIDPdfExporter
    • applyBackgroundColorStrToCell

      protected void applyBackgroundColorStrToCell(String colorString, com.lowagie.text.pdf.PdfPCell cell, Color nullColor)
    • applyRowHeightToCell

      protected void applyRowHeightToCell(Float rowHeight, com.lowagie.text.pdf.PdfPCell cell)
    • applyFontStrToParagraph

      protected void applyFontStrToParagraph(com.lowagie.text.Paragraph p, String fontStr)
    • buildRow

      protected void buildRow(List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, com.lowagie.text.pdf.PdfPTable table, int dataRowIndex, List<String> dataRow, Color rowToggleColor)
    • applyTextColorStrToParagraph

      protected void applyTextColorStrToParagraph(String textColorString, com.lowagie.text.Paragraph p)
    • findExplicitRowHeight

      protected Float findExplicitRowHeight(int dataRowIndex)
    • findExplicitHeaderRowHeight

      protected Float findExplicitHeaderRowHeight(int rowIndex)
    • findExplicitFooterRowHeight

      protected Float findExplicitFooterRowHeight(int rowIndex)
    • findBackgroundColorForDataCell

      protected String findBackgroundColorForDataCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findBackgroundColorForHeaderCell

      protected String findBackgroundColorForHeaderCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findBackgroundColorForFooterCell

      protected String findBackgroundColorForFooterCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findAlignmentForDataCell

      protected String findAlignmentForDataCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findAlignmentForHeaderCell

      protected String findAlignmentForHeaderCell(int headerRowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findAlignmentForFooterCell

      protected String findAlignmentForFooterCell(int footerRowIndex, String 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, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findTextColorForHeaderCell

      protected String findTextColorForHeaderCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findTextColorForFooterCell

      protected String findTextColorForFooterCell(int rowIndex, String 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, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findFontForHeaderCell

      protected String findFontForHeaderCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • findFontForFooterCell

      protected String findFontForFooterCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column)
      Cell processing: Explicit possibility to override by an own implementation.
    • createDocument

      protected com.lowagie.text.Document createDocument(FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns)
      Creation of iText document object. Calculation of size of page according to column widths.
    • beforeTitle

      protected void beforeTitle(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data)
      Method for adding information to be printed in front of the title.
    • printTitle

      protected void printTitle(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data)
    • afterTitle

      protected void afterTitle(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data)
      Method for adding information to be printed behind the grid.
    • beforeGrid

      protected void beforeGrid(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data)
      Method for adding information to be printed in front of the grid.
    • afterGrid

      protected void afterGrid(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data)
      Method for adding information to be printed behind the grid.
    • calculateColumnWidth

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

      protected String objectToString(String s)
    • createParagraph

      protected com.lowagie.text.Paragraph createParagraph(String text, com.lowagie.text.Font font, com.lowagie.text.pdf.FontSelector fontSelector)