Documentation

Styled Excel and PDF export

Three of the ten export formats need the Enterprise package: excel-list, excel-pivot and pdf. The other seven — CSV, JSON in three shapes, XML, print and clipboard — are free.

Everything structural is in the free core: flattening rows, building merged headers, resolving values, evaluating conditional-format rules. What Enterprise adds is the writing — ExcelJS and jsPDF, plus a streaming fallback for large sheets.

Turning it on

Importing anything from the Enterprise package registers the exporter. There is no configuration:

import { EnterprisePivotGrid } from '@kanunilabs/pivotgrid-react-enterprise';

The footer's download menu then enables the three paid entries. From code:

const ref = useRef<PivotGridRef<Sale>>(null);

ref.current?.exportData('excel-pivot', {
  fileName: 'Q4-revenue',
  applyFilters: true,
  expandAll: false,
  locale: 'tr-TR',
});

exportData returns void, not a Promise — there is nothing to await and nothing to catch.

OptionDefaultRead by the exporter
fileName'PivotExport'yes — the extension is appended
locale'tr-TR'pivot only; the flat list ignores it
applyFiltersyes
expandAllyes
signalonly at chunk boundaries
onProgressplumbed, never wired to any UI

ExportFormat and ExportOptions come from @kanunilabs/pivotgrid-core, not from the React package.

What this does not do

Size silently changes the file

excel-list past 100,000 rows stops producing a real .xlsx and starts producing SpreadsheetML with an .xls extension. Same menu item, same name, different file — and in that format every formatted number is written as a string, which Excel will not sum.

The pivot equivalent switches at 150,000 materialised cells and additionally drops conditional formatting, outline levels, frozen panes and column widths.

There is no warning at either threshold.

The file will not match the screen

Absent from every export path:

  • cellTemplate output — the exporter writes the underlying value
  • theme colours
  • vertical header merges
  • dataFieldPosition: 'rows', which the grid honours and the exporters ignore
  • localized total labels — the screen says "Genel Toplam", the file says "Grand Total". Nothing in the export is translated, although the translations exist.
  • conditional rules other than expression
  • when several conditional rules match a cell, the screen merges them all; the export applies the first

Progress and cancellation are not reachable from the UI

The footer menu passes neither signal nor onProgress — both are fully plumbed and wired to nothing. You can only use them through your own ref.

Even then, cancellation is coarse: the signal is polled at chunk boundaries and not during the three most expensive calls, and aborting discards all work.

PDF

A wide pivot gets one accommodation: landscape orientation. No page breaking by column, no scaling, no per-column widths.

No font is registered, so non-ASCII text is at risk — worth checking with Turkish characters before you rely on it, given the default export locale is tr-TR.

Community behaviour is a console warning

With nothing registered, the export logs a warning and returns. It does not throw and does not reject — but onExporting has already fired, so an app that shows a spinner on that event will spin forever.

Not licence-gated

There is no licence check anywhere in the export path. Importing the Enterprise package registers the exporter at module scope, for every grid in the bundle — including a Community BasePivotGrid in the same application.

The boundary here is the private registry, not a runtime check.