Skip to content

GridExcelExportOptions API

The options to apply on the Excel export.

Demos

Import

import { GridExcelExportOptions } from '@mui/x-data-grid-premium'

Properties

allColumnsOptional

If true, the hidden columns will also be exported.

Type:boolean

Default:false


columnsStylesOptional

Object mapping column field to Exceljs style

Type:ColumnsStylesInterface


escapeFormulasOptional

If false, the formulas in the cells will not be escaped.
It is not recommended to disable this option as it exposes the user to potential CSV injection attacks.
See https://owasp.org/www-community/attacks/CSV_Injection for more information.

Type:boolean

Default:true


exceljsPostProcessOptional

Method called after adding the rows to the workbook.
Not supported when worker is set.
To use with web workers, use the option in setupExcelExportWebWorker.

Type:(processInput: GridExceljsProcessInput) => Promise<void>


exceljsPreProcessOptional

Method called before adding the rows to the workbook.
Not supported when worker is set.
To use with web workers, use the option in setupExcelExportWebWorker.

Type:(processInput: GridExceljsProcessInput) => Promise<void>


fieldsOptional

The columns exported.
This should only be used if you want to restrict the columns exports.

Type:string[]


fileNameOptional

The string used as the file name.

Type:string

Default:document.title


getRowsToExportOptional

Function that returns the list of row ids to export on the order they should be exported.

Type:(params: GridGetRowsToExportParams<Api>) => GridRowId[]


includeColumnGroupsHeadersOptional

If true, the headers of the column groups will be added into the file.

Type:boolean

Default:true


includeHeadersOptional

If true, the first row of the file will include the headers of the grid.

Type:boolean

Default:true


valueOptionsSheetNameOptional

Name given to the worksheet containing the columns valueOptions.
valueOptions are added to this worksheet if they are provided as an array.

Type:string


workerOptional

Function to return the Worker instance to be called.

Type:() => Worker