Skip to content

GridExcelExportOptions API

Extended documentation for the GridExcelExportOptions interface with detailed information on the module's properties and available APIs.

Demos

Import

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


The options to apply on the Excel export.

Properties

Optional

If `true`, the hidden columns will also be exported.

Type:boolean

Default:false


Optional

Object mapping column field to Exceljs style

Type:ColumnsStylesInterface


Optional

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


Optional

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: { workbook: Workbook, worksheet: Worksheet }) => Promise<void>


Optional

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: { workbook: Workbook, worksheet: Worksheet }) => Promise<void>


Optional

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

Type:string[]


Optional

The string used as the file name.

Type:string

Default:document.title


Optional

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

Type:(params: { apiRef: RefObject<GridApiCommunity> }) => GridRowId[]


Optional

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

Type:boolean

Default:true


Optional

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

Type:boolean

Default:true


Optional

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

Type:string


Optional

Function to return the Worker instance to be called.

Type:() => Worker