Class DataTableExcelExporter

    • Field Detail

      • wb

        protected org.apache.poi.ss.usermodel.Workbook wb
    • Constructor Detail

      • DataTableExcelExporter

        public DataTableExcelExporter()
    • Method Detail

      • doExport

        public void doExport​(javax.faces.context.FacesContext context,
                             DataTable table,
                             ExportConfiguration exportConfiguration,
                             int index)
                      throws IOException
        Description copied from class: DataTableExporter
        Export datatable
        Specified by:
        doExport in class DataTableExporter
        Parameters:
        context - faces context
        table - datatable to export
        exportConfiguration - export configuration
        index - datatable current index during export process
        Throws:
        IOException
      • addTableFacets

        protected void addTableFacets​(javax.faces.context.FacesContext context,
                                      DataTable table,
                                      org.apache.poi.ss.usermodel.Sheet sheet,
                                      DataTableExporter.ColumnType columnType)
      • addColumnValue

        protected void addColumnValue​(org.apache.poi.ss.usermodel.Row row,
                                      javax.faces.component.UIComponent component)
      • addColumnValue

        protected void addColumnValue​(org.apache.poi.ss.usermodel.Row row,
                                      String value)
      • addColumnValue

        protected void addColumnValue​(org.apache.poi.ss.usermodel.Row row,
                                      int col,
                                      String text)
      • addColumnValue

        protected void addColumnValue​(DataTable table,
                                      org.apache.poi.ss.usermodel.Row row,
                                      List<javax.faces.component.UIComponent> components,
                                      UIColumn column)
      • calculateColumnOffset

        protected int calculateColumnOffset​(org.apache.poi.ss.usermodel.Sheet sheet,
                                            int row,
                                            int col)
      • updateCell

        protected void updateCell​(org.apache.poi.ss.usermodel.Cell cell,
                                  String value)
        If ExcelOptions.isStronglyTypedCells = true then for cells check:
         Numeric - String that are all numbers make them a numeric cell
         Currency - Convert to currency cell so math can be done in Excel
         String - fallback to just a normal string cell
         
        Possible future enhancement of Date cells as well.
        Parameters:
        cell - the cell to operate on
        value - the String value to put in the cell
      • createRichTextString

        protected org.apache.poi.ss.usermodel.RichTextString createRichTextString​(String value)
      • createWorkBook

        protected org.apache.poi.ss.usermodel.Workbook createWorkBook()
      • getWorkBook

        protected org.apache.poi.ss.usermodel.Workbook getWorkBook()
      • createSheet

        protected org.apache.poi.ss.usermodel.Sheet createSheet​(org.apache.poi.ss.usermodel.Workbook wb,
                                                                String sheetName,
                                                                ExcelOptions options)
      • getContentType

        public String getContentType()
        Description copied from class: Exporter
        Content-type (MIME-type) excluding charset. (eg 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
        Specified by:
        getContentType in class Exporter<DataTable>
      • exportTable

        public void exportTable​(javax.faces.context.FacesContext context,
                                javax.faces.component.UIComponent component,
                                org.apache.poi.ss.usermodel.Sheet sheet,
                                ExportConfiguration exportConfiguration)
      • applyOptions

        protected void applyOptions​(org.apache.poi.ss.usermodel.Workbook wb,
                                    DataTable table,
                                    org.apache.poi.ss.usermodel.Sheet sheet,
                                    ExporterOptions options)
      • applyFacetOptions

        protected void applyFacetOptions​(org.apache.poi.ss.usermodel.Workbook wb,
                                         ExporterOptions options,
                                         org.apache.poi.ss.usermodel.CellStyle facetStyle)
      • applyCellOptions

        protected void applyCellOptions​(org.apache.poi.ss.usermodel.Workbook wb,
                                        ExporterOptions options,
                                        org.apache.poi.ss.usermodel.CellStyle cellStyle)
      • applyColumnAlignments

        protected org.apache.poi.ss.usermodel.Cell applyColumnAlignments​(UIColumn column,
                                                                         org.apache.poi.ss.usermodel.Cell cell)
      • getSheetName

        public String getSheetName​(javax.faces.context.FacesContext context,
                                   javax.faces.component.UIComponent table)
      • getFont

        public org.apache.poi.ss.usermodel.Font getFont​(org.apache.poi.ss.usermodel.Workbook wb,
                                                        ExporterOptions options)