The options to apply on the CSV export.

interface GridCsvExportOptions {
    allColumns?: boolean;
    delimiter?: string;
    escapeFormulas?: boolean;
    fields?: string[];
    fileName?: string;
    getRowsToExport?: ((params: GridCsvGetRowsToExportParams<GridApiCommunity>) => GridRowId[]);
    includeColumnGroupsHeaders?: boolean;
    includeHeaders?: boolean;
    utf8WithBom?: boolean;
}

Hierarchy (view full)

Properties

allColumns?: boolean

If true, the hidden columns will also be exported.

false
delimiter?: string

The character used to separate fields.

','
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: GridCsvGetRowsToExportParams<GridApiCommunity>) => GridRowId[])

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

Type declaration

includeColumnGroupsHeaders?: boolean

If true, the CSV will include the column groups.

See column groups docs for more details.

true
includeHeaders?: boolean

If true, the CSV will include the column headers and column groups. Use includeColumnGroupsHeaders to control whether the column groups are included.

true
utf8WithBom?: boolean

If true, the UTF-8 Byte Order Mark (BOM) prefixes the exported file. This can allow Excel to automatically detect file encoding as UTF-8.

false