GRID FEATURE · PRO
Excel export
Excel export generates XLSX bytes or downloads a file. This Pro feature suits exchanges requiring sheet names and workbook format beyond CSV.
How it works and when to use it
exportDataAsExcel downloads a file; getDataAsExcel returns Uint8Array. Use the bytes for uploads or attachments without interpreting them as text.
Using this feature in a product requires the Pro package and a valid license. Matching setting names do not enable Pro features in Community.
In the code, grid is the Grid element prepared in the installation chapter. Check each example's data and settings, and implement the app functions and server endpoints for your project.
Example 1. Download an orders file
Choose clear file and sheet names.
await grid.exportDataAsExcel({ fileName: 'orders.xlsx', sheetName: 'Orders' });Verify the result: Inspect the result in the XLSX file's Orders sheet.
Example 2. Send selected orders only
Select rows first, then limit the scope.
await grid.exportDataAsExcel({ onlySelected: true, columnKeys: ['product', 'quantity'] });Verify the result: Only specified columns from selected rows are exported. Also check the no-selection result and the app's explanation.
Example 3. Use file bytes
Connect the result to attachment previews or app uploads.
const bytes = await grid.getDataAsExcel({ sheetName: 'Orders' });
const blob = new Blob([bytes], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
console.log(blob.size);Verify the result: Create a File object without downloading. Implement external uploads in your app.
Combining features and troubleshooting
Do not expect arbitrary HTML renderers or app buttons to become equivalent Excel cells. Check the supported data and formatting scope.
Exporting all server data has a different scope from exporting the current Grid. Consider server-generated reports for large datasets.
Related reading
- How rows, columns, and IDs relate
- Connect results and events
- Explore in Features
The guide describes which interactions are available to try.