Excel Writer

This node writes the input data table into a spreadsheet of an Excel file, which can then be read with other applications such as Microsoft Excel. The node can create completely new files or append data to an existing Excel file. When appending, the input data can be appended as a new spreadsheet or after the last row of an existing spreadsheet. By adding multiple data table input ports, the data can be written/appended to multiple spreadsheets within the same file.

The node supports two formats chosen by file extension:

  • .xls format: This is the file format which was used by default up until Excel 2003. The maximum number of columns and rows held by a spreadsheet of this format is 256 and 65536 respectively.
  • .xlsx format: The Office Open XML format is the file format used by default from Excel 2007 onwards. The maximum number of columns and rows held by a spreadsheet of this format is 16384 and 1048576 respectively.

If the data does not fit into a single sheet, it will be split into multiple chunks that are written to newly chosen sheet names sequentially. The new sheet names are derived from the originally selected sheet name by appending " (i)" to it, where i=1,...,n.
When appending to a file, a sheet may already exist. In this case the node will (according to its settings) either replace the sheet, fail or append rows after the last row in that sheet. This can be used to append data to an Excel file without having to create a new sheet name once the original sheet is full by just selecting the original sheet name. The data will be appendend to the last sheet in the name sequence. The original sheet name does not have to be changed.

This node does not support writing files in the '.xlsm' format, yet appending is supported.

This node can access a variety of different file systems. More information about file handling in KNIME can be found in the official File Handling Guide.

Options

Excel format
Select the Excel file format to write.
  • XLSX: The Office Open XML format is the file format used by default from Excel 2007 onwards. The maximum number of columns and rows held by a spreadsheet of this format is 16384 and 1048576 respectively.
  • XLS: This is the file format which was used by default up until Excel 2003. The maximum number of columns and rows held by a spreadsheet of this format is 256 and 65536 respectively.
File Selection
The file selection.
Create missing folders
If enabled, missing folders in the specified path will be created automatically.
If exists
Specify the behavior of the node in case the output file already exists.
  • Fail: Will issue an error during the node's execution (to prevent unintentional overwrite).
  • Overwrite: Will replace any existing file.
  • Append: Will append the input data to an existing file.
Password to protect files
Allows you to specify a password to protect the output file with. In case the "append" option is selected and the file already exists, the password must be valid for the existing file.
  • None: Only files without password protection can be updated.
  • Credentials: Use a password set via workflow credentials.
  • Password: Specify a password.
Workflow credentials
Select the workflow credentials to use.
Password
Enter the password to protect the file.
Sheets
  • Sheet name: Name of the spreadsheets that will be created. The dropdown can be used to select a sheet name which already exists in the Excel file or a custom name can be entered. If "If sheet exists" isn't set to append, each sheet name must be unique. The node appends the tables in the order they are connected.
If sheet exists
Specify the behavior of the node in case a sheet with the entered name already exists. (This option is only relevant if the file append option is selected.)
  • Fail: Will issue an error during the node's execution (to prevent unintentional overwrite).
  • Overwrite: Will replace any existing sheet.
  • Append: Will append the input tables after the last row of the sheets. Note: the last row is chosen according to the rows which already exist in the sheet. A row may appear empty but still exist because it or one of its cells contains styling information or was not removed by Excel after the user cleared it.
Merge data with identical sheet names into one sheet
If checked, it is possible to provide the same sheet name for multiple input tables. Data from those tables will be concatenated into the same sheet in the order the tables are connected.
Write row key
If checked, the row IDs are added to the output, in the first column of the spreadsheet.
Write column headers
If checked, the column names are written out in the first row of the spreadsheet.
Don't write column headers if sheet exists
Only write the column headers if a sheet is newly created or replaced. This option is convenient if you have written data with the same specification to an existing sheet before and want to append new rows to it.
Replace missing values
If selected, missing values will be replaced by the specified value, otherwise a blank cell is being created.
Evaluate formulas (leave unchecked if uncertain, see help for details)
If checked, all formulas in the file will be evaluated after the sheet has been written. This is useful if other sheets in the file refer to the data just written and their content needs updating. This option is only relevant if the append option is selected. This can cause errors when there are functions that are not implemented by the underlying Apache POI library. Note: For xlsx files, evaluation requires significantly more memory as the whole file needs to be kept in memory (xls files are anyway loaded completely into memory).
Autosize columns
Fits each column's width to its content.
Page orientation
Sets the print format to portrait or landscape.
Paper size
Sets the paper size in the print setup.
Open file after execution
If enabled, the output file will be opened in the associated application after the node has successfully executed.

Input Ports

Icon
The data table to write.
Icon
The file system connection.
Icon
Additional data table to write.

Output Ports

This node has no output ports

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.