Excel Export allows you to select which rows get exported to Excel.
By default, all the rows in the grid are included in the Excel export. However, you can set which rows are exported and configure how they are rendered within the Excel file.
By default, all visible rows are exported, but by using the
onlySelected param, only the selected rows will be exported.
By default Excel renders every exported value in a cell using a single line. If you need to display a cell value on multiple lines, please set the Excel Alignment
wrapText option as shown in sample below.
By default, the grid exports grid rows after filtering and sorting has been applied. This means that if you’ve filtered the grid, only the filtered rows will be exported in the order they appear in visually at the time of export.
You can override this and export all rows instead of only the filtered rows by setting the
exportedRows param to ‘all’.
When exporting all rows, any column filters or sort applied to the grid are ignored and all rows are exported in the original order.
You can verify this in the example below:
- Filter the Country column to only show rows for Australia
- Sort descending by Athlete column
- Uncheck the All Rows checkbox and click the Export to Excel button
Observe how only the filtered rows are exported in the Excel file in descending order by Athlete column
- Check the All Rows checkbox and click the Export to Excel button
Observe how all rows are exported in the Excel file in the original unsorted row order
If you'd like to exclude pinned top/bottom rows in AG Grid from the Excel export, please set the
skipPinnedBottom properties to true.
Note the following:
- By default, all pinned rows are exported.
Skip Pinned Top Rowsis checked, the rows pinned at the top will be skipped.
Skip Pinned Bottom Rowsis checked, the rows pinned at the bottom will be skipped.
Continue to the next section: Columns.