Excel Export
The KendoReact TreeList provides options for exporting its data to Excel in hierarchical tree format.
Start Free TrialGetting Started
To enable the Excel export:
-
Install
kendo-react-excel-export
package.shnpm install @progress/kendo-react-excel-export @progress/kendo-licensing
-
Import the ExcelExport component in your React Application.
jsximport { ExcelExport } from '@progress/kendo-react-excel-export';
-
Wrap the TreeList inside an ExcelExport component.
-
Set the hierarchy prop of the ExcelExport to true.
-
Transform the data to a flat array with a level for each data record, using the treeToFlat function provided by the TreeList package.
-
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.
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.
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.
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.