Class ExporterExcel

java.lang.Object
com.helger.photon.exchange.bulkexport.format.ExporterExcel
All Implemented Interfaces:
IExporter, IExporterFile

@NotThreadSafe public class ExporterExcel extends Object implements IExporterFile
Export records to Excel workbook.
Author:
Philip Helger
  • Field Details

    • DEFAULT_AUTOSIZE_ALL_COLUMNS

      public static final boolean DEFAULT_AUTOSIZE_ALL_COLUMNS
      See Also:
  • Constructor Details

    • ExporterExcel

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

    • getFileType

      @Nonnull public final EExchangeFileType getFileType()
      Specified by:
      getFileType in interface IExporterFile
      Returns:
      The file type for export.
    • getExcelVersion

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

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

      @Nonnull public final ExporterExcel setStyleBoolean(@Nullable com.helger.poi.excel.style.ExcelStyle aStyle)
    • getStyleInt

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

      @Nonnull public final ExporterExcel setStyleInt(@Nullable com.helger.poi.excel.style.ExcelStyle aStyle)
    • getStyleDouble

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

      @Nonnull public final ExporterExcel setStyleDouble(@Nullable com.helger.poi.excel.style.ExcelStyle aStyle)
    • getStyleText

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

      @Nonnull public final ExporterExcel setStyleText(@Nullable com.helger.poi.excel.style.ExcelStyle aStyle)
    • getStyleDate

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

      @Nonnull public final ExporterExcel setStyleDate(@Nonnull com.helger.poi.excel.style.ExcelStyle aStyle)
    • getStyleTime

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

      @Nonnull public final ExporterExcel setStyleTime(@Nonnull com.helger.poi.excel.style.ExcelStyle aStyle)
    • getStyleDateTime

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

      @Nonnull public final ExporterExcel setStyleDateTime(@Nonnull com.helger.poi.excel.style.ExcelStyle aStyle)
    • 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.