ReportPivotGrid, ReportPivotGridLinkCell
Reference
ReportPivotGridrenders a table with the same header and row styling as the standard report grid. It is built for the bucket table of a custom report: one row per bucket (for example a month) and one column per category.- The first column is frozen. The other columns share the remaining width (never narrower than 130 px) and every column can be resized by dragging its header edge.
ReportPivotGridLinkCellrenders a clickable number in the same style the standard report uses for drill-down cells.
Props
-
columns- Type:
Array<{ key, dataKey, title, cellRenderer? }> - Required: Yes
- Description: Column definitions.
titlecan be a string or a React node (for exampleTextwithSanitizedHTML).cellRenderer({ rowData })returns the cell content. Column widths are set by the grid.
- Type:
-
data- Type:
Array<object> - Required: Yes
- Description: One object per row.
- Type:
-
rowKey- Type:
string - Default:
'id' - Description: The property that identifies a row.
- Type:
-
rowHeight/headerHeight- Type:
number - Default:
50 - Description: Row and header height in pixels (the same defaults as the standard grid).
- Type:
-
maxHeight- Type:
number - Default: The window height available below the grid
- Description: Upper bound for the grid height. When the rows need more, the grid scrolls inside itself.
- Type:
-
sortBy/sortDirection/onSortChange- Type:
string/'asc' | 'desc'/(columnKey) => void - Description: Pass
onSortChangeto make the headers clickable. The grid shows the sort arrow forsortBy; sortingdatais done by the widget.
- Type:
-
paginate- Type:
boolean - Default:
false - Description: Adds the standard report footer: rows per page (25, 50, 75 or 100; default 50), the record range and page buttons. Rows are paged in the browser, the page goes back to 1 when the number of rows changes, and the grid fills the space down to the footer. Without it the grid renders exactly as before.
- Type:
ReportPivotGridLinkCell Props
value— The number or text to show. An empty value is shown as-.onClick— Called when the user clicks the value.
Usage Example
function Example(pageContext) {
const { protrakComponents } = React.useContext(customWidgetContext);
const { ReportPivotGrid, ReportPivotGridLinkCell } = protrakComponents;
const columns = [
{ key: 'month', dataKey: 'month', title: 'Month', frozen: 'left' },
{
key: 'keys',
dataKey: 'keys',
title: 'Keys',
cellRenderer: ({ rowData }) => (
<ReportPivotGridLinkCell
value={rowData.keys}
onClick={() => console.log('open drill-down for', rowData.id)}
/>
),
},
];
const rows = [
{ id: '2026-09', month: 'Sep-2026', keys: 15842 },
{ id: '2026-10', month: 'Oct-2026', keys: 16110 },
];
return <ReportPivotGrid columns={columns} data={rows} rowKey="id" paginate />;
}
See the Bucket-Based Drill-Down Report pattern for a complete widget.