View as Markdown

API reference: @salmonui/export/pivot

PivotFileExportOptionsinterface

import type { PivotFileExportOptions } from '@salmonui/export/pivot';
interface PivotFileExportOptions extends PivotExportOptions {
    readonly format?: PivotExportFormat;
    readonly xlsx?: XlsxOptions;
    readonly pdf?: PdfOptions;
    readonly csv?: CsvOptions;
    readonly chart?: ExportImage | readonly ExportImage[];
}

exportPivot() options: the pivot options, the format, and that format's writer options.

PivotFileExportOptions members (19, 14 inherited)
NameSignatureDescription
formatoptionalreadonly format?: PivotExportFormat;

Default xlsx.

xlsxoptionalreadonly xlsx?: XlsxOptions;

XLSX writer options (sheet names, layout: 'stacked' for several results on one sheet, header and footer rows, styles).

pdfoptionalreadonly pdf?: PdfOptions;

PDF writer options (page size, orientation, font, page header and footer).

csvoptionalreadonly csv?: CsvOptions;

CSV options (delimiter, BOM; values: 'formatted' writes the formatted texts instead of the raw numbers).

chartoptionalreadonly chart?: ExportImage | readonly ExportImage[];

PDF only: chart image(s) (PNG or JPEG bytes with their CSS px size, e.g. from Chart's toBlob('png')), each on its own page after the table: table and chart in one PDF. Same as pdf.appendImages.

fileNameoptionalinheritedfileName?: string;

File name; the extension is added. Default export.

rowLayoutoptionalinheritedrowLayout?: "compact" | "tabular";

compact (default): one indented row header column; tabular: one column per row level.

rowHeadersoptionalinheritedrowHeaders?: boolean;

Row header columns. Default true.

rowHeaderCaptionoptionalinheritedrowHeaderCaption?: string;

Header text of the row header column(s). Default: the row field captions.

rowHeaderWidthoptionalinheritedrowHeaderWidth?: number;

Column widths in CSS px. Defaults 200 (row headers) and 110.

columnWidthoptionalinheritedcolumnWidth?: number;
includeColumnoptionalinheritedincludeColumn?: ((header: PivotExportHeader, index: number) => boolean);

Exported value columns (hidden columns, current page only). Default every leaf column.

rowRangeoptionalinheritedrowRange?: readonly [number, number];

Exported leaf row positions [start, end) (current page only). Default every row.

includeRowoptionalinheritedincludeRow?: ((header: PivotExportHeader, index: number) => boolean);

Exported rows. Default every visible leaf row.

pivotStylesoptionalinheritedpivotStyles?: PivotExportStyles;

Subtotal, grand total and row header styles (merged under conditional formats and the hook).

celloptionalinheritedcell?: ((ctx: PivotExportCellContext) => void | ExportCellOverride | null | undefined);

Per body cell.

headerCelloptionalinheritedheaderCell?: ((ctx: PivotExportHeaderContext) => void | { readonly text?: string; readonly style?: ExportCellStyle; } | null | undefined);

Per header cell.

windowCellsoptionalinheritedwindowCells?: number;

Window sources: cells per pivot request while paging. Default 200,000.

localeoptionalinheritedlocale?: string;

Locale of the model (number formats in PDF / CSV come from formattedValue).