Excel Export

The TreeList provides options for exporting its data to Excel.

To enable the Excel export, import the ExcelModule and add the kendo-treelist-excel component to the Kendo UI TreeList for Angular. To initiate the export, use the kendoTreeListExcelCommand directive or the saveAsExcel method.

Example
View Source
Edit In Stackblitz  
Change Theme:

Configuration

With regard to its Excel export, the TreeList enables you to:

Exporting Specific Data

By default, the TreeList exports its current data. To export data that is different from the current TreeList data, specify a custom fetchData function. The function should return an ExcelExportData object.

If the export data needs to be asynchronously loaded, you can set an Observable to the data field.

All Pages

By default, the TreeList exports all pages of the current data. To export only the current page set the the allPages option to false.

Expanded State

By default, the TreeList expands all items during export. To export the data with the currently expanded items, set expandAll to false.

Customizing Exported Columns

By default, the TreeList exports its current columns. To export columns that are different from the current TreeList columns, include the <kendo-excelexport-column> and <kendo-excelexport-column-group> components inside the <kendo-treelist-excel> component.

Customizing Generated Workbooks

The excelExport event allows you to customize the generated Excel document. The workbook event argument exposes the generated Excel workbook configuration.

Triggering Export Externally

The TreeList enables you to trigger the export operation by calling the saveAsExcel method.

Making Item Levels Collapsible

The collapsible option allows you to create a collapsible outline for each item level.

The option is only applicable if the TreeList has footers.

Known Limitations

  • During the export to Excel, the cell templates of the TreeList are not evaluated. Instead, the TreeList exports only the data and the field value is serialized to preserve the type information. To tweak the cell content, use an accessor or transform the data in advance.
  • During the export to Excel, the TreeList does not use column formats. Column formats are incompatible with Excel. For more information, refer to the page on the Excel-supported formats.
  • The maximum size of the exported file to Excel has a system-specific limit. For large data sets, it is highly recommended that you use a server-side solution.
  • When you export the TreeList to Excel in older browsers, such as Internet Explorer 9 and Safari, you have to implement a server proxy. For more information, refer to the proxyUrl configuration.