writeExcel
Writes this DataFrame to an Excel file as a single sheet.
Implemented with Apache POI using HSSFWorkbook for XLS files, XSSFWorkbook for standard XLSX files, and SXSSFWorkbook for memory-efficient streaming when creating new XLSX files.
Parameters
The path to the file where the data will be written.
A selector to determine which columns to include in the file. The default is all columns.
The name of the sheet in the Excel file. If null, the default name will be used.
A flag indicating whether to write the header row in the Excel file. Defaults to true.
The type of workbook to create (e.g., XLS or XLSX). Defaults to XLSX.
If true and the file already exists, a new sheet will be appended instead of overwriting the file. This may result in higher memory usage and slower performance compared to creating a new file. Defaults to false.
Throws
if the sheetName is invalid or the workbook already contains a sheet with this name.
Writes this DataFrame to an Excel file as a single sheet.
Implemented with Apache POI using HSSFWorkbook for XLS files, XSSFWorkbook for standard XLSX files, and SXSSFWorkbook for memory-efficient streaming when creating new XLSX files.
Parameters
The file where the data will be written.
A selector to determine which columns to include in the file. The default is all columns.
The name of the sheet in the Excel file. If null, the default name will be used.
A flag indicating whether to write the header row in the Excel file. Defaults to true.
The type of workbook to create (e.g., XLS or XLSX). Defaults to XLSX.
If true and the file already exists, a new sheet will be appended instead of overwriting the file. This may result in higher memory usage and slower performance compared to creating a new file. Defaults to false.
Throws
if the sheetName is invalid or the workbook already contains a sheet with this name.
Writes this DataFrame to an Excel file as a single sheet.
Implemented with Apache POI using HSSFWorkbook for XLS files, XSSFWorkbook for standard XLSX files, and SXSSFWorkbook for memory-efficient streaming when creating new XLSX files.
Parameters
The path to a file where the data will be written.
A selector to determine which columns to include in the file. The default is all columns.
The name of the sheet in the Excel file. If null, the default name will be used.
A flag indicating whether to write the header row in the Excel file. Defaults to true.
The type of workbook to create (e.g., XLS or XLSX). Defaults to XLSX.
If true and the file already exists, a new sheet will be appended instead of overwriting the file. This may result in higher memory usage and slower performance compared to creating a new file. Defaults to false.
Throws
if the sheetName is invalid or the workbook already contains a sheet with this name.
Writes this DataFrame to an Excel file using an existing Workbook instance into given OutputStream.
Uses Apache POI. Supports XSSFWorkbook and SXSSFWorkbook for XLSX and HSSFWorkbook for XLS, and allows users to manage the workbook externally.
Parameters
The output stream where the Excel data will be written.
A selector to determine which columns to include in the file. The default is all columns.
The name of the sheet in the Excel file. If null, the default name will be used.
A flag indicating whether to write the header row in the Excel file. Defaults to true.
The Workbook instance, allowing integration with an existing workbook.
Throws
if the sheetName is invalid or the workbook already contains a sheet with this name.
Creates a new Sheet in the given Workbook and writes this DataFrame content into it.
Uses Apache POI. Supports XSSFWorkbook and SXSSFWorkbook for XLSX and HSSFWorkbook for XLS, and allows users to manage the workbook externally.
Automatically handles datetime types. Skips null values to prevent Apache POI from treating empty cells incorrectly.
Return
The created Sheet instance containing the DataFrame data.
Parameters
The Workbook where the sheet will be created.
A selector to determine which columns to include. Defaults to all columns.
The name of the sheet. If null, a default sheet name is used.
Whether to include a header row with column names. Defaults to true.
Throws
if the sheetName is invalid or the workbook already contains a sheet with this name.