React Data Grid: Excel Export - Columns
Excel Export allows you to select which columns get exported to Excel.
By default, all the currently visible columns in the grid are included in the Excel export. However, you can easily control which specific columns are exported to the Excel file.
By default column headers and group column headers are included in the Excel export. However, you can suppress the export for column header rows using the
skipColumnHeaders properties to
Note the following:
- By default, all grouped column header rows and the column header row are exported.
- Group Headers will be skipped if Skip Column Group Headers is checked.
- Normal headers will be skipped if Skip Column Headers is checked.
By default, hidden columns are not included in the export. If you need all columns to be exported even if they're currently hidden in the grid, set the allColumns property to true.
Note the following:
- By default, only visible columns will be exported. The bronze, silver and gold columns will not.
All Columnsis checked, the bronze, silver and gold columns will be included in the exported file.
Grouped columns can be exported to Excel as grouped columns. However, there are a few points to keep in mind to configure this correctly:
- By default only visible columns are exported. Collapsed columns are hidden and as such aren’t exported to Excel. In order to export collapsed columns, set
allColumns: truein the ExcelExportParams provided to the grid. However, this will also export all hidden columns in the grid. If you want to export collapsed columns but not all hidden columns, you can set the list of columns to be exported via the columnKeys property.
- Excel doesn't have a
columnGroupShow: 'closed'equivalent, so this option will not work the same when collapsing columns in Excel.
- If two collapsible groups are side-by-side, Excel will merge these two groups into one.
In the example below, export the grid to Excel, open the exported Excel document and note the following:
- The columns Gold, Silver, Bronze will appear as a collapsible column group in the exported Excel document.
- The exported Excel document will also contain the Total column, but this column will not be included in the "collapsible" group.
Continue to the next section: Data Types.