Skip to main content

xlsx()

Description

Exports data from a spreadsheet into an Excel (.xlsx) file

Usage

xlsx(name:string): void;

Parameters

  • name - (optional) the name of an exported .xlsx file

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
// config parameters
});
spreadsheet.parse(data);

// exports data from a spreadsheet into an Excel file
spreadsheet.export.xlsx();

// exports data from a spreadsheet into an Excel file with a custom name
spreadsheet.export.xlsx("MyData");
note

Note that the component supports export to Excel files with the .xlsx extension only.

Besides cell values, an exported file keeps the cell styles, the number formats, the merged cells, the frozen columns and rows, the links, the drop-down editors, and the locked state of cells. All of them are restored on import of the file back into Spreadsheet.

info

DHTMLX Spreadsheet uses the WebAssembly-based library Json2Excel to export data to Excel. Check the details.

Related article: Data loading and export

Related sample: Spreadsheet. Export Xlsx