The options applicable to any document export format (CSV and Excel).

interface GridFileExportOptions<Api> {
    allColumns?: boolean;
    escapeFormulas?: boolean;
    fields?: string[];
    fileName?: string;
    getRowsToExport?: ((params: GridGetRowsToExportParams<Api>) => GridRowId[]);
    includeHeaders?: boolean;
}

Type Parameters

Hierarchy (view full)

Properties

allColumns?: boolean

If true, the hidden columns will also be exported.

false
escapeFormulas?: boolean

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.

true
fields?: string[]

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

fileName?: string

The string used as the file name.

document.title
getRowsToExport?: ((params: GridGetRowsToExportParams<Api>) => GridRowId[])

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

Type declaration

includeHeaders?: boolean

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

true