Core Features

Advanced Features

Angular Data GridPDF Export - Rows

Version 36.2.0
Enterprise

PDF Export includes rows after filtering and sorting by default. Export options can select rows, change their order, omit groups, and control pinned rows.

Export Selected Rows Copy Link

Set onlySelected=true to export selected rows. With pagination, use onlySelectedAllPages=true to include selections from every page.

this.gridApi.exportDataAsPdf({
    onlySelected: true,
});

Text Wrapping And Row Height Copy Link

Cells remain on one line by default. Enable wrapping globally with defaultCellStyle.wrapText, per column with colDef.wrapText, or per element with processStyleCallback.

this.gridApi.exportDataAsPdf({
    defaultCellStyle: {
        wrapText: true,
        maxLines: 3,
    },
});

Without a fixed height, rows grow to fit wrapped content and can continue across pages. An explicit rowHeight or headerRowHeight fixes the available height and clips overflowing text.

Supported white-space values returned by cellStyle are also translated into wrapping, line-break preservation, and space preservation.

Row Order Copy Link

The default exportedRows='filteredAndSorted' follows the displayed row order. Use 'all' to export the original unfiltered and unsorted row set.

this.gridApi.exportDataAsPdf({
    exportedRows: 'all',
});

Selection and shouldRowBeSkipped can still remove rows from this set.

Row Groups Copy Link

Row groups are exported with indentation based on their displayed level. Set rowGroupIndentSize to change the indentation, or skipRowGroups=true to omit group rows.

this.gridApi.exportDataAsPdf({
    rowGroupIndentSize: 12,
});

Pinned Rows Copy Link

Pinned top and bottom rows are exported by default. Use skipPinnedTop or skipPinnedBottom to omit them.

Manually pinned rows can also appear in the body. Set skipPinnedRowDuplicates=true to keep only their pinned copies.

this.gridApi.exportDataAsPdf({
    skipPinnedTop: true,
    skipPinnedRowDuplicates: true,
});

Choose Rows Programmatically Copy Link

Use rowPositions to export specific row positions, or shouldRowBeSkipped to omit rows conditionally.

this.gridApi.exportDataAsPdf({
    shouldRowBeSkipped: ({ node }) => node.data?.status === 'Archived',
});

API Copy Link

Export Options Copy Link

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

defaultCellStyleCopy Link
PdfCellStyle
default: { fontFamily: 'Helvetica', fontSize: 10, padding: 4 }
Default style applied to every body cell, including custom content rows. Grid styles, row and cell styles, and processStyleCallback results override these values. When no style is provided, body cells use Helvetica at 10 points.
rowGroupIndentSizeCopy Link
number
default: 12
Horizontal indentation in points for each row-group level.
rowHeightCopy Link
number
default: calculated from font size and padding
Height of body rows in points. If omitted, calculated from font size and padding.
headerRowHeightCopy Link
number
default: calculated from header font size and padding
Height of header rows in points. If omitted, calculated from header font size and padding.
rowPositionsCopy Link
RowPosition[]
Row node positions.
exportedRowsCopy Link
'all' | 'filteredAndSorted'
default: 'filteredAndSorted'
Determines whether rows are exported before being filtered and sorted.
onlySelectedCopy Link
boolean
default: false
Export only selected rows.
onlySelectedAllPagesCopy Link
boolean
default: false
Only export selected rows including other pages (only makes sense when using pagination).
skipRowGroupsCopy Link
boolean
default: false
Set to true to skip row group headers if grouping rows. Only relevant when grouping rows.
skipPinnedTopCopy Link
boolean
default: false
Set to true to suppress exporting rows pinned to the top of the grid.
skipPinnedBottomCopy Link
boolean
default: false
Set to true to suppress exporting rows pinned to the bottom of the grid.
skipPinnedRowDuplicatesCopy Link
boolean
default: false
Set to true to omit the body copies of manually pinned rows. The rows in the pinned sections are still exported unless skipPinnedTop or skipPinnedBottom is enabled.
shouldRowBeSkippedCopy Link
Function
A callback function that will be invoked once per row in the grid. Return true to omit the row from the export.

ShouldRowBeSkippedParams Copy Link

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

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

RowPosition Copy Link

Properties available on the RowPosition interface.

rowIndexCopy Link
number
A positive number from 0 to n, where n is the last row the grid is rendering or -1 if you want to navigate to the grid header
rowPinnedCopy Link
RowPinnedType
Either 'top', 'bottom' or null/undefined (for not pinned)