Excel Output
Writes records into an Excel file
Processing
For each incoming row, the step writes a record into an Excel sheet.
The Excel workbook can be based on a template file or created from scratch.
The sheet name, data fields, and cell format are controlled through configuration settings.
Settings
Name | Type | Description |
---|---|---|
General | ||
Mode |
string |
Determines how the Excel file is constructed.
When using streaming mode, only a minimal amount of information is kept in memory. As a consequence the following limitations apply:
Evaluated once when step initializes |
Output File |
string |
The path of the output file. If the file does not exist, a new workbook file is created. Evaluated for each input row |
If File Exists |
string |
Determines what to do if the output file already exists.
Evaluated for each input row |
Sheet Name |
string |
The sheet to write data to. (Max 31 characters) If the sheet does not exist in the workbook, it is created. Evaluated for each input row |
If Sheet Exists |
string |
Determines what to do if the output sheet already exists.
Evaluated for each input row |
Settings | ||
Write Header |
boolean |
If enabled, the step writes a header row with column names before the data rows. If disabled, only data rows are written. Evaluated for each input row |
Header Format Cell |
string |
If a header row is written, the header styles are inherited from the given cell. You can specify as cell in ColumnRow format, such as This feature is useful when you’re using a template file that contains pre-styled cells. Evaluated for each input row |
Start At |
string |
Defines the cell to start writing to. Specify as cell in ColumnRow format, such as Evaluated for each input row |
Append |
boolean |
If enabled, the step ignores the start row indicated by the Start At setting and appends rows after any existing rows in the sheet. Evaluated for each input row |
Existing Rows |
string |
Determines how any existing content in the sheet is handled when writing data
Note that this setting takes effect only when working in ‘memory’ mode. Streaming mode always appends new rows after any existing content. Evaluated once when step initializes |
Auto-Size Columns |
boolean |
If enabled, columns written to the sheet are auto-sized to fit their content. Please note that enabling this setting can affect step performance. Estimating the size of cell content is computationally intensive. Evaluated once when step initializes |
Formula Recalculation |
string |
Determines how formulas are recalculated.
It is recommended to let Excel perform formula evaluations upon opening the file. Note however that if the file is never opened by Excel, formula values are not recalculated. In cases where the generated file is immediately passed on for further processing, programs other than Excel may not see up-to-date values. To support such cases, in memory evaluation of formulas can be attempted on a best-effort basis. It cannot be guaranteed to work in all circumstances. Test your templates thoroughly if you wish to use in memory formula evaluation. Evaluated once when step initializes |
Templates | ||
Template File |
string |
Path to an *.xlsx file used as a template use when creating new output files. A copy of the template file is used to write data into. Leave empty or Evaluated for each input row |
Template Sheet |
string |
Name of a template sheet to clone when creating new output sheets. Leave empty or Evaluated for each input row |
Columns | ||
Columns |
How output table structure is established:
Specified at design time |
Columns - fixed
Sheet Columns
Defines data written to the Excel sheet.
Evaluated for each input row
- Name
- Name of the field. This is used in headers and footers.
- Value
- The value to write.
- Format
- Formatting details applied to cell.
Columns - data driven
When output columns are data driven, the step determines table structure at runtime.
Name | Type | Description |
---|---|---|
Column Names |
list |
A list defining the columns written to file. Eeach entry can be one of:
To specify three output columns you would supply a definition such as:
The following is equivalent:
Evaluated for each new file |
Column Values |
list or dict |
A list or dict defining the data to write. If the data structure is a list, the value for each column is extracted in order. If the data structure is a dict, the values for columns are extracted by using column names as keys. For example, consider the following column definition:
We can supply column values as a list:
We can also supply column values as a dict:
Evaluated for each input row |
Column Formats |
list or dict |
A list or dict defining the cell format to write. If the data structure is a list, the format for each column is extracted in order. If the data structure is a dict, the format for columns is extracted by using column names as keys. Each format is expected to to evaluate to a cell format definition. For example, consider the following column definition:
We can supply cell formats as a list:
We can also supply formats as a dict:
Evaluated for each input row |
Results
This step does not provide any results.