AG Studio Launch Week 🚀🚀🚀 28 Sep - 2 Oct 2026 🚀🚀🚀 Join now




Core Features

Advanced Features

React Data GridPDF Export - Customising Content

Version 36.2.0
Enterprise

PDF Export uses Value Getters and, by default, Value Formatters. Export callbacks can replace the resulting text without changing the values displayed in the grid.

Customising Cell and Row Group Values Copy Link

Use processCellCallback and processRowGroupCallback in defaultPdfExportParams to customise exported body cells and row groups.

const processCellCallback = (params) => `_${params.value ?? ''}_`;
const processRowGroupCallback = (params) => `row group: ${params.node.key ?? ''}`;

<AgGridReact
    processCellCallback={processCellCallback}
    processRowGroupCallback={processRowGroupCallback}
/>

See below the functions on the PdfExportParams interface to customise exported grid cell and row group values.

processCellCallbackCopy Link
Function
A callback function invoked once per cell in the grid. Return a string value to be displayed in the export. For example this is useful for formatting date values.
processRowGroupCallbackCopy Link
Function
A callback function invoked once per row group. Return a string to be displayed in the group cell.

The following example adds the prefix row group: to row-group values and surrounds body-cell values with underscores in the exported PDF.

Customising Column Headers and Group Header Values Copy Link

Use processHeaderCallback and processGroupHeaderCallback to customise exported column headers and column-group headers.

const processHeaderCallback = (params) => `header: ${params.api.getDisplayNameForColumn(params.column, null)}`;
const processGroupHeaderCallback = (params) =>
    `group header: ${params.api.getDisplayNameForColumnGroup(params.columnGroup, null)}`;

<AgGridReact
    processHeaderCallback={processHeaderCallback}
    processGroupHeaderCallback={processGroupHeaderCallback}
/>

See below the functions on the PdfExportParams interface to customise exported column group headers and headers.

processHeaderCallbackCopy Link
Function
A callback function invoked once per column. Return a string to be displayed in the column header.
processGroupHeaderCallbackCopy Link
Function
A callback function invoked once per column group. Return a string to be displayed in the column group header. Note that column groups are exported by default, this option will not work with skipColumnGroupHeaders=true.

The following example prefixes exported headers with header: and exported group headers with group header: .

These callbacks return text. To style the processed result, use processStyleCallback; its value is the final exported string.