# Excel export

Excel export generates XLSX bytes or downloads a file. This Pro feature suits exchanges requiring sheet names and workbook format beyond CSV.

Canonical: https://grid.syidax.com/docs/features/excel-export/

<a id="understand"></a>

## 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.

- [Installation and integration · Shared sample data](https://grid.syidax.com/docs/guides/getting-started.md)

<a id="example-1"></a>

## Example 1. Download an orders file

Choose clear file and sheet names.

```javascript
await grid.exportDataAsExcel({ fileName: 'orders.xlsx', sheetName: 'Orders' });
```

Verify the result: Inspect the result in the XLSX file's Orders sheet.

<a id="example-2"></a>

## Example 2. Send selected orders only

Select rows first, then limit the scope.

```javascript
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.

<a id="example-3"></a>

## Example 3. Use file bytes

Connect the result to attachment previews or app uploads.

```javascript
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.

<a id="pitfalls"></a>

## 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.

<a id="related-api"></a>

## APIs used by this feature

- [getDataAsExcel](https://grid.syidax.com/docs/methods/getDataAsExcel.md) — Generates XLSX content as Uint8Array bytes for app attachments, uploads, and similar uses.
- [exportDataAsExcel](https://grid.syidax.com/docs/methods/exportDataAsExcel.md) — Downloads an XLSX file using the specified sheet name, columns, and selection conditions.

<a id="next"></a>

## Related reading

- [How rows, columns, and IDs relate](https://grid.syidax.com/docs/guides/concepts.md)
- [Connect results and events](https://grid.syidax.com/docs/guides/data-event-access.md)
- [Explore in Features](https://grid.syidax.com/grid/excel-export) — The guide describes which interactions are available to try.
