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 Summary
Fields Modifier and Type Field Description static booleanDEFAULT_AUTOSIZE_ALL_COLUMNS
-
Constructor Summary
Constructors Constructor Description ExporterExcel(com.helger.poi.excel.EExcelVersion eVersion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.helger.commons.state.ESuccessexportRecords(IExportRecordProvider aProvider, OutputStream aOS)Export all provided records to an output stream.com.helger.poi.excel.EExcelVersiongetExcelVersion()EExchangeFileTypegetFileType()com.helger.poi.excel.style.ExcelStylegetStyleBoolean()com.helger.poi.excel.style.ExcelStylegetStyleDate()com.helger.poi.excel.style.ExcelStylegetStyleDateTime()com.helger.poi.excel.style.ExcelStylegetStyleDouble()com.helger.poi.excel.style.ExcelStylegetStyleInt()com.helger.poi.excel.style.ExcelStylegetStyleText()com.helger.poi.excel.style.ExcelStylegetStyleTime()booleanisAutoSizeAllColumns()protected 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.ExporterExcelsetAutoSizeAllColumns(boolean bAutoSizeAllColumns)ExporterExcelsetStyleBoolean(com.helger.poi.excel.style.ExcelStyle aStyle)ExporterExcelsetStyleDate(com.helger.poi.excel.style.ExcelStyle aStyle)ExporterExcelsetStyleDateTime(com.helger.poi.excel.style.ExcelStyle aStyle)ExporterExcelsetStyleDouble(com.helger.poi.excel.style.ExcelStyle aStyle)ExporterExcelsetStyleInt(com.helger.poi.excel.style.ExcelStyle aStyle)ExporterExcelsetStyleText(com.helger.poi.excel.style.ExcelStyle aStyle)ExporterExcelsetStyleTime(com.helger.poi.excel.style.ExcelStyle aStyle)
-
-
-
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
-
getFileType
@Nonnull public final EExchangeFileType getFileType()
- Specified by:
getFileTypein interfaceIExporterFile- 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 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.
-
-