Excel Export

The KendoReact TreeList provides options for exporting its data to Excel in hierarchical tree format.

The TreeList Package is part of KendoReact, a professionally built commercial UI library. To try out this TreeList you need to sign up for a 30-day trial, which gives you access to the full KendoReact library.


Getting Started

To enable the Excel export:

  1. Install kendo-react-excel-export package.

    npm install @progress/kendo-react-excel-export @progress/kendo-licensing
  2. Import the ExcelExport component in your React Application.

    import { ExcelExport } from '@progress/kendo-react-excel-export';
  3. Wrap the TreeList inside an ExcelExport component.

  4. Set the hierarchy prop of the ExcelExport to true.

  5. Transform the data to a flat array with a level for each data record, using the treeToFlat function provided by the TreeList package.

  6. Pass the flat array and columns that have to be exported to the save function.

The following example demonstrates the basic implementation of the Excel export functionality of the TreeList.

Example
View Source
Edit In Stackblitz  
Change Theme:

Configuration

You can entirely control the Excel export configuration through the arguments that are passed to the save function of the KendoReact Excel Export component.

The ExcelExport enables you to:

Exporting Specific Data

To export specific data, pass the data to the save function of the ExcelExport component. For example, if the TreeList has its paging enabled but you need to export only the current page, pass the paged data to the save function.

Example
View Source
Edit In Stackblitz  
Change Theme:

Customizing Exported Workbook

When exporting the excel file we provide an option to customize the generated workbook. This can be used to modify the values, the appearance or the sheets in the document. The following example demonstrates how to add a different background color on the alt rows.

Example
View Source
Edit In Stackblitz  
Change Theme:

Known Limitations

  • 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 use the ExcelExport 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 of the ExcelExport component.