Class ExporterExcel

    • Field Detail

      • DEFAULT_AUTOSIZE_ALL_COLUMNS

        public static final boolean DEFAULT_AUTOSIZE_ALL_COLUMNS
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExporterExcel

        public ExporterExcel​(@Nonnull
                             com.helger.poi.excel.EExcelVersion eVersion)
    • Method Detail

      • getExcelVersion

        @Nonnull
        public final com.helger.poi.excel.EExcelVersion getExcelVersion()
      • getStyleBoolean

        @Nullable
        @ReturnsMutableCopy
        public final com.helger.poi.excel.style.ExcelStyle getStyleBoolean()
      • getStyleInt

        @Nullable
        @ReturnsMutableCopy
        public final com.helger.poi.excel.style.ExcelStyle getStyleInt()
      • getStyleDouble

        @Nullable
        @ReturnsMutableCopy
        public final com.helger.poi.excel.style.ExcelStyle getStyleDouble()
      • getStyleText

        @Nullable
        @ReturnsMutableCopy
        public final com.helger.poi.excel.style.ExcelStyle getStyleText()
      • getStyleDate

        @Nonnull
        @ReturnsMutableCopy
        public final com.helger.poi.excel.style.ExcelStyle getStyleDate()
      • getStyleTime

        @Nonnull
        @ReturnsMutableCopy
        public final com.helger.poi.excel.style.ExcelStyle getStyleTime()
      • getStyleDateTime

        @Nonnull
        @ReturnsMutableCopy
        public final com.helger.poi.excel.style.ExcelStyle getStyleDateTime()
      • isAutoSizeAllColumns

        public final boolean isAutoSizeAllColumns()
      • setAutoSizeAllColumns

        @Nonnull
        public final ExporterExcel setAutoSizeAllColumns​(boolean bAutoSizeAllColumns)
      • onAddRow

        @OverrideOnDemand
        protected void onAddRow​(@Nonnull
                                com.helger.poi.excel.WorkbookCreationHelper aWBCH,
                                @Nonnull
                                EExportRecordType eRecordType,
                                @Nonnull
                                org.apache.poi.ss.usermodel.Row aRow,
                                @Nonnegative
                                int nRowIndex)
        Callback when a new row is created.
        Parameters:
        aWBCH - The creation helper
        eRecordType - The record type
        aRow - The created row.
        nRowIndex - The 0-based total index of the row (including header)
      • onAddCell

        @OverrideOnDemand
        protected void onAddCell​(@Nonnull
                                 com.helger.poi.excel.WorkbookCreationHelper aWBCH,
                                 @Nonnull
                                 EExportRecordType eRecordType,
                                 @Nonnull
                                 org.apache.poi.ss.usermodel.Cell aCell,
                                 @Nonnegative
                                 int nCellIndex,
                                 @Nonnull
                                 EExportDataType eBaseType)
        Callback when a new row is created.
        Parameters:
        aWBCH - The creation helper
        eRecordType - The record type
        aCell - The created cell.
        nCellIndex - The 0-based index of the cell in the current row
        eBaseType - The data type of the last cells data.
      • exportRecords

        @Nonnull
        public final com.helger.commons.state.ESuccess exportRecords​(@Nonnull
                                                                     IExportRecordProvider aProvider,
                                                                     @Nonnull @WillClose
                                                                     OutputStream aOS)
        Description copied from interface: IExporter
        Export all provided records to an output stream.
        Specified by:
        exportRecords in interface IExporter
        Parameters:
        aProvider - The provider for all records. May not be null.
        aOS - The output stream to write to. Will be closed automatically in any case. May not be null.
        Returns:
        ESuccess.SUCCESS if at lease one record was provided and saving was successful.