Class ExcelExporter


  • public class ExcelExporter
    extends Exporter
    Exporter component.
    Since:
    0.7.0
    Author:
    Sudheer Jonna / last modified by $Author$
    • Constructor Summary

      Constructors 
      Constructor Description
      ExcelExporter()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addColumnAlignments​(javax.faces.component.UIComponent component, org.apache.poi.ss.usermodel.Cell cell)  
      protected void addColumnFacets​(org.primefaces.component.datatable.DataTable table, org.apache.poi.ss.usermodel.Sheet sheet, Exporter.ColumnType columnType)  
      protected void addColumnFacets​(org.primefaces.component.subtable.SubTable table, org.apache.poi.ss.usermodel.Sheet sheet, Exporter.ColumnType columnType)  
      protected void addColumnValue​(org.apache.poi.ss.usermodel.Row row, java.util.List<javax.faces.component.UIComponent> components, org.primefaces.component.api.UIColumn column)  
      protected void addColumnValue​(org.apache.poi.ss.usermodel.Row row, javax.faces.component.UIComponent component)  
      protected void createCustomFonts()  
      void customFormat​(java.lang.String facetBackground, java.lang.String facetFontSize, java.lang.String facetFontColor, java.lang.String facetFontStyle, java.lang.String fontName, java.lang.String cellFontSize, java.lang.String cellFontColor, java.lang.String cellFontStyle, java.lang.String datasetPadding, java.lang.String orientation)  
      void export​(javax.faces.event.ActionEvent event, java.lang.String tableId, javax.faces.context.FacesContext context, java.lang.String filename, java.lang.String tableTitle, boolean pageOnly, boolean selectionOnly, java.lang.String encodingType, javax.el.MethodExpression preProcessor, javax.el.MethodExpression postProcessor, boolean subTable)  
      protected void exportAll​(javax.faces.context.FacesContext context, org.primefaces.component.datatable.DataTable table, org.apache.poi.ss.usermodel.Sheet sheet, boolean subTable)  
      protected void exportAll​(org.primefaces.component.datalist.DataList list, org.apache.poi.ss.usermodel.Sheet sheet)  
      protected void exportAll​(org.primefaces.component.subtable.SubTable table, org.apache.poi.ss.usermodel.Sheet sheet)  
      protected void exportCells​(org.primefaces.component.datalist.DataList list, org.apache.poi.ss.usermodel.Sheet sheet)  
      protected void exportCells​(org.primefaces.component.datatable.DataTable table, org.apache.poi.ss.usermodel.Sheet sheet)  
      protected void exportCells​(org.primefaces.component.subtable.SubTable table, org.apache.poi.ss.usermodel.Sheet sheet)  
      protected void exportPageOnly​(org.primefaces.component.datalist.DataList list, org.apache.poi.ss.usermodel.Sheet sheet)  
      protected void exportPageOnly​(org.primefaces.component.datatable.DataTable table, org.apache.poi.ss.usermodel.Sheet sheet)  
      protected void exportRow​(org.primefaces.component.datalist.DataList list, org.apache.poi.ss.usermodel.Sheet sheet, int rowIndex)  
      protected void exportRow​(org.primefaces.component.datatable.DataTable table, org.apache.poi.ss.usermodel.Sheet sheet, int rowIndex)  
      protected void exportRow​(org.primefaces.component.subtable.SubTable table, org.apache.poi.ss.usermodel.Sheet sheet, int rowIndex)  
      protected void exportSelectionOnly​(javax.faces.context.FacesContext context, org.primefaces.component.datatable.DataTable table, org.apache.poi.ss.usermodel.Sheet sheet)  
      protected void tableColumnGroup​(org.apache.poi.ss.usermodel.Sheet sheet, org.primefaces.component.datatable.DataTable table, java.lang.String facetType)  
      protected void tableColumnGroup​(org.apache.poi.ss.usermodel.Sheet sheet, org.primefaces.component.subtable.SubTable table, java.lang.String facetType)  
      protected void tableFacet​(javax.faces.context.FacesContext context, org.apache.poi.ss.usermodel.Sheet sheet, org.primefaces.component.datalist.DataList list)  
      protected void tableFacet​(javax.faces.context.FacesContext context, org.apache.poi.ss.usermodel.Sheet sheet, org.primefaces.component.datatable.DataTable table, int columnCount, java.lang.String facetType)  
      protected void tableFacet​(javax.faces.context.FacesContext context, org.apache.poi.ss.usermodel.Sheet sheet, org.primefaces.component.subtable.SubTable table, int columnCount, java.lang.String facetType)  
      protected static void writeExcelToResponse​(javax.faces.context.ExternalContext externalContext, org.apache.poi.ss.usermodel.Workbook generatedExcel, java.lang.String filename)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExcelExporter

        public ExcelExporter()
    • Method Detail

      • export

        public void export​(javax.faces.event.ActionEvent event,
                           java.lang.String tableId,
                           javax.faces.context.FacesContext context,
                           java.lang.String filename,
                           java.lang.String tableTitle,
                           boolean pageOnly,
                           boolean selectionOnly,
                           java.lang.String encodingType,
                           javax.el.MethodExpression preProcessor,
                           javax.el.MethodExpression postProcessor,
                           boolean subTable)
                    throws java.io.IOException
        Specified by:
        export in class Exporter
        Throws:
        java.io.IOException
      • exportAll

        protected void exportAll​(javax.faces.context.FacesContext context,
                                 org.primefaces.component.datatable.DataTable table,
                                 org.apache.poi.ss.usermodel.Sheet sheet,
                                 boolean subTable)
      • exportAll

        protected void exportAll​(org.primefaces.component.subtable.SubTable table,
                                 org.apache.poi.ss.usermodel.Sheet sheet)
      • exportAll

        protected void exportAll​(org.primefaces.component.datalist.DataList list,
                                 org.apache.poi.ss.usermodel.Sheet sheet)
      • exportPageOnly

        protected void exportPageOnly​(org.primefaces.component.datatable.DataTable table,
                                      org.apache.poi.ss.usermodel.Sheet sheet)
      • exportPageOnly

        protected void exportPageOnly​(org.primefaces.component.datalist.DataList list,
                                      org.apache.poi.ss.usermodel.Sheet sheet)
      • exportSelectionOnly

        protected void exportSelectionOnly​(javax.faces.context.FacesContext context,
                                           org.primefaces.component.datatable.DataTable table,
                                           org.apache.poi.ss.usermodel.Sheet sheet)
      • tableFacet

        protected void tableFacet​(javax.faces.context.FacesContext context,
                                  org.apache.poi.ss.usermodel.Sheet sheet,
                                  org.primefaces.component.datatable.DataTable table,
                                  int columnCount,
                                  java.lang.String facetType)
      • tableFacet

        protected void tableFacet​(javax.faces.context.FacesContext context,
                                  org.apache.poi.ss.usermodel.Sheet sheet,
                                  org.primefaces.component.subtable.SubTable table,
                                  int columnCount,
                                  java.lang.String facetType)
      • tableFacet

        protected void tableFacet​(javax.faces.context.FacesContext context,
                                  org.apache.poi.ss.usermodel.Sheet sheet,
                                  org.primefaces.component.datalist.DataList list)
      • tableColumnGroup

        protected void tableColumnGroup​(org.apache.poi.ss.usermodel.Sheet sheet,
                                        org.primefaces.component.datatable.DataTable table,
                                        java.lang.String facetType)
      • tableColumnGroup

        protected void tableColumnGroup​(org.apache.poi.ss.usermodel.Sheet sheet,
                                        org.primefaces.component.subtable.SubTable table,
                                        java.lang.String facetType)
      • exportRow

        protected void exportRow​(org.primefaces.component.datatable.DataTable table,
                                 org.apache.poi.ss.usermodel.Sheet sheet,
                                 int rowIndex)
      • exportRow

        protected void exportRow​(org.primefaces.component.subtable.SubTable table,
                                 org.apache.poi.ss.usermodel.Sheet sheet,
                                 int rowIndex)
      • exportRow

        protected void exportRow​(org.primefaces.component.datalist.DataList list,
                                 org.apache.poi.ss.usermodel.Sheet sheet,
                                 int rowIndex)
      • exportCells

        protected void exportCells​(org.primefaces.component.datatable.DataTable table,
                                   org.apache.poi.ss.usermodel.Sheet sheet)
      • exportCells

        protected void exportCells​(org.primefaces.component.subtable.SubTable table,
                                   org.apache.poi.ss.usermodel.Sheet sheet)
      • exportCells

        protected void exportCells​(org.primefaces.component.datalist.DataList list,
                                   org.apache.poi.ss.usermodel.Sheet sheet)
      • addColumnFacets

        protected void addColumnFacets​(org.primefaces.component.datatable.DataTable table,
                                       org.apache.poi.ss.usermodel.Sheet sheet,
                                       Exporter.ColumnType columnType)
      • addColumnFacets

        protected void addColumnFacets​(org.primefaces.component.subtable.SubTable table,
                                       org.apache.poi.ss.usermodel.Sheet sheet,
                                       Exporter.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,
                                      java.util.List<javax.faces.component.UIComponent> components,
                                      org.primefaces.component.api.UIColumn column)
      • addColumnAlignments

        protected void addColumnAlignments​(javax.faces.component.UIComponent component,
                                           org.apache.poi.ss.usermodel.Cell cell)
      • customFormat

        public void customFormat​(java.lang.String facetBackground,
                                 java.lang.String facetFontSize,
                                 java.lang.String facetFontColor,
                                 java.lang.String facetFontStyle,
                                 java.lang.String fontName,
                                 java.lang.String cellFontSize,
                                 java.lang.String cellFontColor,
                                 java.lang.String cellFontStyle,
                                 java.lang.String datasetPadding,
                                 java.lang.String orientation)
        Specified by:
        customFormat in class Exporter
      • createCustomFonts

        protected void createCustomFonts()
      • writeExcelToResponse

        protected static void writeExcelToResponse​(javax.faces.context.ExternalContext externalContext,
                                                   org.apache.poi.ss.usermodel.Workbook generatedExcel,
                                                   java.lang.String filename)
                                            throws java.io.IOException
        Throws:
        java.io.IOException