Class XlsxTargetFactory
Factory methods that create an
XlsxTarget<TInput>
dataflow worker with one Input port, which consumes incoming rows and
writes them to a rectangular area on one sheet in an XLSX spreadsheet file.
No driver installation is required (it uses the
EPPlus library internally).
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Get the factory from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).
Also see XLSX Spreadsheet.
Namespace: actionETL.EPPlus
Assembly: actionETL.dll
Syntax
public static class XlsxTargetFactory
Methods
XlsxTarget<TInput>(in DownstreamFactory<TInput>, String, Action<IXlsxTargetCommand>, String)
Initializes a new instance of the XlsxTarget<TInput> dataflow worker, which consumes incoming rows and writes them to an XLSX spreadsheet file. The worker will fail if the XLSX file already exists.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static XlsxTarget<TInput> XlsxTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Action<IXlsxTargetCommand> xlsxTargetCommands, string fileName)
where TInput : class
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Action<IXlsxTargetCommand> | xlsxTargetCommands | The commands that defines where to write, which columns to include, and their formatting, e.g.:
Must be set before the worker runs. Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. The default write address is the top left cell (i.e. "A1") on the first sheet. If there is no existing sheet, a new sheet called "Sheet1" will be created. |
| String | fileName | The filename of the XLSX file. |
Returns
| Type | Description |
|---|---|
| XlsxTarget<TInput> |
Type Parameters
| Name | Description |
|---|---|
| TInput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
XlsxTarget<TInput>(in DownstreamFactory<TInput>, String, Action<IXlsxTargetCommand>, String, XlsxTargetWriteOption)
Initializes a new instance of the XlsxTarget<TInput> dataflow worker, which consumes incoming rows and writes them to an XLSX spreadsheet file.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static XlsxTarget<TInput> XlsxTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Action<IXlsxTargetCommand> xlsxTargetCommands, string fileName, XlsxTargetWriteOption writeOption)
where TInput : class
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Action<IXlsxTargetCommand> | xlsxTargetCommands | The commands that defines where to write, which columns to include, and their formatting, e.g.:
Must be set before the worker runs. Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match. The default write address is the top left cell (i.e. "A1") on the first sheet. If there is no existing sheet, a new sheet called "Sheet1" will be created. |
| String | fileName | The filename of the XLSX file. |
| XlsxTargetWriteOption | writeOption | Controls whether to use, overwrite, or fail when there is an existing file. |
Returns
| Type | Description |
|---|---|
| XlsxTarget<TInput> |
Type Parameters
| Name | Description |
|---|---|
| TInput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|