toExcel

exports data of a data component to an Excel document

promise toExcel(string|object id, [object options] );
idstring|objectthe exported view or its id
optionsobjectoptional, a set of configuration options that define what data will be displayed in the Excel file
promisea "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:

  1. providing a custom filename and sheet name
  2. stripping HTML tags from the cells
  3. setting custom columns for export
  4. defining custom header, width or template for data in the specified column
  5. including extra fields into export
  6. rendering raw values or templates set in the widget dataset
  7. including column and row spans from Datatable header and body into export
  8. disabling file download in a browser, if necessary
  9. ignoring particular columns during export
  10. inclduing hidden columns and rows during export
  11. hiding columns and rows during export
  12. including cell styles from Datatable header and body into export
  13. exporting row heights
  14. omitting the header or footer of Datatable during export
  15. outputting certain data from a data set
  16. specifying the desired type of data and setting format for exported dates and numbers
  17. exporting frozen rows and columns
  18. export of images
See also
Back to top