Class ExcelPipelineOutput
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineOutput
com.northconcepts.datapipeline.foundations.pipeline.output.FileSinkPipelineOutput
com.northconcepts.datapipeline.foundations.pipeline.output.ExcelPipelineOutput
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,DataWriterFactory,JavaCodeGenerator,Serializable
A pipeline output that writes to an Excel file using the
ExcelWriter.
This ExcelPipelineOutput does not support Excel cell styles and formatting, but only supports data formats for different field types. See setDataFormat(FieldType, String).
- See Also:
-
Field Summary
Fields inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
internalId, internalName, log, TIMESTAMP_FORMATFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).fromXmlElement(Element pipelineOutputElement) voidAppends Java source code representing this object to the given builder.voidWrites the generated code that saves the output afterJob.run(reader, writer); does nothing by default.Returns the Excel data formats set per field type, applied over the writer's defaults, or null if none were set.getDataFormats(boolean create) Returns the data formats per field type, first creating an empty map ifcreateis true and there is none.intReturns the 0-based column each record's first field is written to (defaults to 0).intReturns the 0-based row the header or first record is written to (defaults to 0).Gets the number of columns to freeze (make non-scrollable) in the Excel sheet.Gets the number of rows to freeze (make non-scrollable) in the Excel sheet.Returns how text values longer than an Excel cell's 32,767 characters are handled (defaults toLargeCellHandler.FAIL).getName()Returns a display name for this output, such as the destination's name followed by its format.Returns the provider used to write the workbook (defaults toExcelDocument.ProviderType.POI_XSSF).intReturns the 0-based index of the sheet to write (defaults to -1, a new sheet at the end).Returns the name of the sheet to write or blank to use a generated name (defaults to null).Deprecated.getStyleFormats(boolean create) Deprecated.usegetDataFormats(boolean)insteadbooleanIndicates if drop-down filters are added to the first written row, usually the header (defaults to false).booleanIndicates if columns are widened to fit their widest value (defaults to false).booleanIndicates if a header row of field names is written first (defaults to true).setAutoFilterColumns(boolean autoFilterColumns) Indicates if drop-down filters are added to the first written row, usually the header (defaults to false).setAutofitColumns(boolean autofitColumns) Indicates if columns are widened to fit their widest value (defaults to false).setDataFormat(FieldType fieldType, String dataFormat) Sets the Excel data format, such as0.00orm/d/yy, for cells of the given field type; neither may be null.setFieldNamesInFirstRow(boolean fieldNamesInFirstRow) Indicates if a header row of field names is written first (defaults to true).setFileSink(FileSink fileSink) setFirstColumnIndex(int firstColumnIndex) Sets the 0-based column each record's first field is written to (defaults to 0).setFirstRowIndex(int firstRowIndex) Sets the 0-based row the header or first record is written to (defaults to 0).setFreezeColumns(Integer freezeColumns) Sets the number of columns to freeze (make non-scrollable) in the Excel sheet.setFreezeRows(Integer freezeRows) Sets the number of rows to freeze (make non-scrollable) in the Excel sheet.setLargeCellHandler(LargeCellHandler largeCellHandler) Sets how text values longer than an Excel cell's 32,767 characters are handled (defaults toLargeCellHandler.FAIL).setProviderType(ExcelDocument.ProviderType providerType) Sets the provider used to write the workbook (defaults toExcelDocument.ProviderType.POI_XSSF).setSheetIndex(int sheetIndex) Sets the 0-based index of the sheet to write (defaults to -1, a new sheet at the end).setSheetName(String sheetName) Sets the name of the sheet to write or blank to use a generated name (defaults to null).setStyleFormat(FieldType fieldType, String dataFormat) Deprecated.usesetDataFormat(FieldType, String)insteadtoRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.toXmlElement(Document document) Returns an element, created withdocument, describing this object; the default implementation throws aDataException.Methods inherited from class com.northconcepts.datapipeline.foundations.pipeline.PipelineOutput
getNestedPipelineOutput, getPipelineOutput, getRootPipelineOutputMethods inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
addExceptionProperties, assertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalIdMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionProperties
-
Constructor Details
-
ExcelPipelineOutput
public ExcelPipelineOutput()
-
-
Method Details
-
getName
Description copied from class:PipelineOutputReturns a display name for this output, such as the destination's name followed by its format.- Overrides:
getNamein classFileSinkPipelineOutput
-
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable- Overrides:
toRecordin classBean
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceRecordSerializable- Overrides:
fromRecordin classPipelineOutput- Parameters:
source-- Returns:
- this instance.
-
getProviderType
Returns the provider used to write the workbook (defaults toExcelDocument.ProviderType.POI_XSSF). -
setProviderType
Sets the provider used to write the workbook (defaults toExcelDocument.ProviderType.POI_XSSF). -
getSheetName
Returns the name of the sheet to write or blank to use a generated name (defaults to null). -
getSheetIndex
public int getSheetIndex()Returns the 0-based index of the sheet to write (defaults to -1, a new sheet at the end). -
setSheetIndex
Sets the 0-based index of the sheet to write (defaults to -1, a new sheet at the end). -
getFirstRowIndex
public int getFirstRowIndex()Returns the 0-based row the header or first record is written to (defaults to 0). -
setFirstRowIndex
Sets the 0-based row the header or first record is written to (defaults to 0). -
getFirstColumnIndex
public int getFirstColumnIndex()Returns the 0-based column each record's first field is written to (defaults to 0). -
setFirstColumnIndex
Sets the 0-based column each record's first field is written to (defaults to 0). -
isAutofitColumns
public boolean isAutofitColumns()Indicates if columns are widened to fit their widest value (defaults to false). -
setAutofitColumns
Indicates if columns are widened to fit their widest value (defaults to false). -
isAutoFilterColumns
public boolean isAutoFilterColumns()Indicates if drop-down filters are added to the first written row, usually the header (defaults to false). -
setAutoFilterColumns
Indicates if drop-down filters are added to the first written row, usually the header (defaults to false). -
isFieldNamesInFirstRow
public boolean isFieldNamesInFirstRow()Indicates if a header row of field names is written first (defaults to true). -
setFieldNamesInFirstRow
Indicates if a header row of field names is written first (defaults to true). -
getLargeCellHandler
Returns how text values longer than an Excel cell's 32,767 characters are handled (defaults toLargeCellHandler.FAIL). -
setLargeCellHandler
Sets how text values longer than an Excel cell's 32,767 characters are handled (defaults toLargeCellHandler.FAIL). -
setSheetName
Sets the name of the sheet to write or blank to use a generated name (defaults to null). -
createDataWriter
-
getFileSink
- Specified by:
getFileSinkin classFileSinkPipelineOutput
-
setFileSink
- Specified by:
setFileSinkin classFileSinkPipelineOutput
-
getStyleFormats
Deprecated.usegetDataFormats()instead -
getDataFormats
Returns the Excel data formats set per field type, applied over the writer's defaults, or null if none were set. -
getStyleFormats
Deprecated.usegetDataFormats(boolean)instead -
getDataFormats
Returns the data formats per field type, first creating an empty map ifcreateis true and there is none. -
setStyleFormat
Deprecated.usesetDataFormat(FieldType, String)instead -
setDataFormat
Sets the Excel data format, such as0.00orm/d/yy, for cells of the given field type; neither may be null. -
getFreezeRows
Gets the number of rows to freeze (make non-scrollable) in the Excel sheet.Frozen rows remain visible at the top of the sheet when scrolling vertically.
- Returns:
- the number of rows to freeze, or
nullif no rows are frozen
-
setFreezeRows
Sets the number of rows to freeze (make non-scrollable) in the Excel sheet.Frozen rows remain visible at the top of the sheet when scrolling vertically.
- Parameters:
freezeRows- the number of rows to freeze, ornullto not freeze any rows- Returns:
- this instance for method chaining
-
getFreezeColumns
Gets the number of columns to freeze (make non-scrollable) in the Excel sheet.Frozen columns remain visible on the left side of the sheet when scrolling horizontally.
- Returns:
- the number of columns to freeze, or
nullif no columns are frozen
-
setFreezeColumns
Sets the number of columns to freeze (make non-scrollable) in the Excel sheet.Frozen columns remain visible on the left side of the sheet when scrolling horizontally.
- Parameters:
freezeColumns- the number of columns to freeze, ornullto not freeze any columns- Returns:
- this instance for method chaining
-
generateJavaCode
Description copied from interface:JavaCodeGeneratorAppends Java source code representing this object to the given builder. -
generateSaveCode
Description copied from class:FileSinkPipelineOutputWrites the generated code that saves the output afterJob.run(reader, writer); does nothing by default.- Overrides:
generateSaveCodein classFileSinkPipelineOutput
-
toXmlElement
Description copied from interface:XmlSerializableReturns an element, created withdocument, describing this object; the default implementation throws aDataException.- Specified by:
toXmlElementin interfaceXmlSerializable- Overrides:
toXmlElementin classPipelineOutput
-
fromXmlElement
-
getDataFormats()instead