toExcel
exports data of a data component to an Excel document
promise toExcel(string|object id, [object options] );
id | string|object | the exported view or its id |
options | object | optional, a set of configuration options that define what data will be displayed in the Excel file |
promise | a "promise" object. The promise is resolved with the contents of an Excel file that is ready for downloading. |
Example
webix.toExcel($$("table"), {
filename: "table", // for filename
name: "Films", // for sheet name
// more config options
});
Related samples
Details
The method returns all data specified in the columns parameter of the DataTable view.
The data are exported into an Excel document with "Data" name and "Data" sheet name.
However, you may need to get some particular data, or customize file and sheet names.
Export API allows:
- providing a custom filename and sheet name
- stripping HTML tags from the cells
- setting custom columns for export
- defining custom header, width or template for data in the specified column
- including extra fields into export
- rendering raw values or templates set in the widget dataset
- including column and row spans from Datatable header and body into export
- disabling file download in a browser, if necessary
- ignoring particular columns during export
- inclduing hidden columns and rows during export
- hiding columns and rows during export
- including cell styles from Datatable header and body into export
- exporting row heights
- omitting the header or footer of Datatable during export
- outputting certain data from a data set
- specifying the desired type of data and setting format for exported dates and numbers
See also
Back to top