Class ExporterExcel
java.lang.Object
com.helger.photon.exchange.bulkexport.format.ExporterExcel
- All Implemented Interfaces:
IExporter,IExporterFile
Export records to Excel workbook.
- Author:
- Philip Helger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal com.helger.commons.state.ESuccessexportRecords(IExportRecordProvider aProvider, OutputStream aOS) Export all provided records to an output stream.final com.helger.poi.excel.EExcelVersionfinal EExchangeFileTypefinal com.helger.poi.excel.style.ExcelStylefinal com.helger.poi.excel.style.ExcelStylefinal com.helger.poi.excel.style.ExcelStylefinal com.helger.poi.excel.style.ExcelStylefinal com.helger.poi.excel.style.ExcelStylefinal com.helger.poi.excel.style.ExcelStylefinal com.helger.poi.excel.style.ExcelStylefinal booleanprotected voidonAddCell(com.helger.poi.excel.WorkbookCreationHelper aWBCH, EExportRecordType eRecordType, org.apache.poi.ss.usermodel.Cell aCell, int nCellIndex, EExportDataType eBaseType) Callback when a new row is created.protected voidonAddRow(com.helger.poi.excel.WorkbookCreationHelper aWBCH, EExportRecordType eRecordType, org.apache.poi.ss.usermodel.Row aRow, int nRowIndex) Callback when a new row is created.final ExporterExcelsetAutoSizeAllColumns(boolean bAutoSizeAllColumns) final ExporterExcelsetStyleBoolean(com.helger.poi.excel.style.ExcelStyle aStyle) final ExporterExcelsetStyleDate(com.helger.poi.excel.style.ExcelStyle aStyle) final ExporterExcelsetStyleDateTime(com.helger.poi.excel.style.ExcelStyle aStyle) final ExporterExcelsetStyleDouble(com.helger.poi.excel.style.ExcelStyle aStyle) final ExporterExcelsetStyleInt(com.helger.poi.excel.style.ExcelStyle aStyle) final ExporterExcelsetStyleText(com.helger.poi.excel.style.ExcelStyle aStyle) final ExporterExcelsetStyleTime(com.helger.poi.excel.style.ExcelStyle aStyle)
-
Field Details
-
DEFAULT_AUTOSIZE_ALL_COLUMNS
public static final boolean DEFAULT_AUTOSIZE_ALL_COLUMNS- See Also:
-
-
Constructor Details
-
ExporterExcel
-
-
Method Details
-
getFileType
- Specified by:
getFileTypein interfaceIExporterFile- Returns:
- The file type for export.
-
getExcelVersion
-
getStyleBoolean
-
setStyleBoolean
@Nonnull public final ExporterExcel setStyleBoolean(@Nullable com.helger.poi.excel.style.ExcelStyle aStyle) -
getStyleInt
-
setStyleInt
@Nonnull public final ExporterExcel setStyleInt(@Nullable com.helger.poi.excel.style.ExcelStyle aStyle) -
getStyleDouble
-
setStyleDouble
@Nonnull public final ExporterExcel setStyleDouble(@Nullable com.helger.poi.excel.style.ExcelStyle aStyle) -
getStyleText
-
setStyleText
@Nonnull public final ExporterExcel setStyleText(@Nullable com.helger.poi.excel.style.ExcelStyle aStyle) -
getStyleDate
-
setStyleDate
@Nonnull public final ExporterExcel setStyleDate(@Nonnull com.helger.poi.excel.style.ExcelStyle aStyle) -
getStyleTime
-
setStyleTime
@Nonnull public final ExporterExcel setStyleTime(@Nonnull com.helger.poi.excel.style.ExcelStyle aStyle) -
getStyleDateTime
-
setStyleDateTime
@Nonnull public final ExporterExcel setStyleDateTime(@Nonnull com.helger.poi.excel.style.ExcelStyle aStyle) -
isAutoSizeAllColumns
public final boolean isAutoSizeAllColumns() -
setAutoSizeAllColumns
-
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 helpereRecordType- The record typeaRow- 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 helpereRecordType- The record typeaCell- The created cell.nCellIndex- The 0-based index of the cell in the current roweBaseType- 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:IExporterExport all provided records to an output stream.- Specified by:
exportRecordsin interfaceIExporter- Parameters:
aProvider- The provider for all records. May not benull.aOS- The output stream to write to. Will be closed automatically in any case. May not benull.- Returns:
ESuccess.SUCCESSif at lease one record was provided and saving was successful.
-