Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.48 KB

export_xlsx_method.md

File metadata and controls

50 lines (34 loc) · 1.48 KB
sidebar_label xlsx()
title xlsx export method
description Export the data of DHTMLX Spreadsheet into an Excel (.xlsx) file with the export.xlsx() method, optionally with a custom file name.

xlsx()

Description

@short: 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_container", {
    // 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