Class BaseExcelExportTemplate<ID extends Serializable,​T extends AbstractEntity<ID>>

    • Method Detail

      • getWorkbook

        protected org.apache.poi.ss.usermodel.Workbook getWorkbook()
      • setWorkbook

        public void setWorkbook​(org.apache.poi.ss.usermodel.Workbook workbook)
      • canResize

        protected boolean canResize()
        Indicates whether it is possible to resize the columns
        Returns:
      • createGenerator

        protected XlsStyleGenerator<ID,​T> createGenerator​(org.apache.poi.ss.usermodel.Workbook workbook)
        Creates the style generator
        Parameters:
        workbook - the work book that is being created
        Returns:
      • createCell

        protected org.apache.poi.ss.usermodel.Cell createCell​(org.apache.poi.ss.usermodel.Row row,
                                                              int colIndex,
                                                              T entity,
                                                              Object value,
                                                              AttributeModel attributeModel,
                                                              Object pivotColumnKey)
        Creates an Excel cell and applies the correct style. The style to use depends on the attribute model and the value to display in the cell
        Parameters:
        row - the row to which to add the cell
        colIndex - the column index of the cell
        entity - the entity that is represented in the row
        value - the cell value
        attributeModel - the attribute model used to determine the style
        Returns:
      • createWorkbook

        protected org.apache.poi.ss.usermodel.Workbook createWorkbook​(int size)
      • resizeColumns

        protected void resizeColumns​(org.apache.poi.ss.usermodel.Sheet sheet)
        Resizes all columns on a sheet if possible
        Parameters:
        sheet - the sheet
      • writeCellValue

        protected void writeCellValue​(org.apache.poi.ss.usermodel.Cell cell,
                                      Object value,
                                      EntityModel<T> em,
                                      AttributeModel am,
                                      boolean forcePercentage)