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




Core Features

Advanced Features

Vue Data GridPDF Export - Master Detail

Version 36.2.0
Enterprise

By default, exporting a Master Detail grid includes the master rows but not their detail grids. Use getCustomContentBelowRow to return a PDF representation of the detail data that should be inserted below each master row.

Exporting Master And Detail Rows Copy Link

getCustomContentBelowRow receives the master row node and returns PdfCell[][]. Build these rows from the detail data stored on the master record:

<ag-grid-vue
    :defaultPdfExportParams="defaultPdfExportParams"
    /* other grid options ... */>
</ag-grid-vue>

this.defaultPdfExportParams = {
    getCustomContentBelowRow: (params) => {
        const records = params.node.data.callRecords;

        return [
            [
                { data: { value: 'Call ID' } },
                { data: { value: 'Direction' } },
                { data: { value: 'Number' } },
                { data: { value: 'Duration / Switch Code' } },
            ],
            ...records.map((record) => [
                { data: { value: String(record.callId) } },
                { data: { value: record.direction } },
                { data: { value: record.number } },
                { data: { value: `${record.duration}s / ${record.switchCode}` } },
            ]),
        ];
    },
};

This approach does not create or export a separate detail-grid instance. It works whether the detail row is expanded or collapsed and avoids creating every detail grid during export.

Detail-grid behaviour is not applied automatically. If detailGridOptions contains Value Getters, Value Formatters, sorting or filtering that should be represented in the PDF, apply the equivalent logic while building the custom rows.

Custom content uses the master table's exported column layout. Build a compact detail representation that fits the number and widths of the exported master columns.

The example below exports a heading, column headers and all call records below each master account row. The duration formatting used by the detail grid is reproduced when the PDF content is created.

API Copy Link

Export Options Copy Link

See below the functions on the PdfExportParams interface to customise exported grid values.

getCustomContentBelowRowCopy Link
Function
A callback function to return content to be inserted below a row in the export.

PdfCell Copy Link

Properties available on the PdfCell interface.

data requiredCopy Link
PdfCellData
The data that will be added to the cell.
mergeAcrossCopy Link
number
default: 0
The number of cells to span across (1 means span 2 columns).
PdfCellStyle
Optional styling for the cell.

PdfCellData Copy Link

Properties available on the PdfCellData interface.

value requiredCopy Link
string | null
The value of the cell.
string
External URI opened when the exported cell text is selected.
PdfImage
Image rendered alongside the cell value.

ProcessRowGroupForExportParams Copy Link

Properties available on the ProcessRowGroupForExportParams<TData = any, TContext = any> interface.

Row node.
The grid column
The grid api.
Application context as set on gridOptions.context.