Skip to main content

ReportPivotGrid, ReportPivotGridLinkCell

Reference​

  • ReportPivotGrid renders 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.
  • ReportPivotGridLinkCell renders a clickable number in the same style the standard report uses for drill-down cells.

Props​

  1. columns

    • Type: Array<{ key, dataKey, title, cellRenderer? }>
    • Required: Yes
    • Description: Column definitions. title can be a string or a React node (for example Text with SanitizedHTML). cellRenderer({ rowData }) returns the cell content. Column widths are set by the grid.
  2. data

    • Type: Array<object>
    • Required: Yes
    • Description: One object per row.
  3. rowKey

    • Type: string
    • Default: 'id'
    • Description: The property that identifies a row.
  4. rowHeight / headerHeight

    • Type: number
    • Default: 50
    • Description: Row and header height in pixels (the same defaults as the standard grid).
  5. 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.
  6. sortBy / sortDirection / onSortChange

    • Type: string / 'asc' | 'desc' / (columnKey) => void
    • Description: Pass onSortChange to make the headers clickable. The grid shows the sort arrow for sortBy; sorting data is done by the widget.
  7. 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.

ReportPivotGridLinkCell Props​

  1. value — The number or text to show. An empty value is shown as -.
  2. 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.