# PivotFileExportOptions (@salmonui/export/pivot)

> The PivotFileExportOptions interface of @salmonui/export/pivot: exportPivot() options: the pivot options, the format, and that format's writer options.

Canonical: https://salmonui.dev/docs/reference/export/pivot/PivotFileExportOptions

```ts
import type { PivotFileExportOptions } from '@salmonui/export/pivot';
```

Entry index: https://salmonui.dev/docs/reference/export/pivot (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/export/pivot.md).

## Reference

Kind: interface

```ts
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.

Members (19):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `format` | `readonly format?: PivotExportFormat;` | optional | Default `xlsx`. |
| `xlsx` | `readonly xlsx?: XlsxOptions;` | optional | XLSX writer options (sheet names, `layout: 'stacked'` for several results on one sheet, header and footer rows, styles). |
| `pdf` | `readonly pdf?: PdfOptions;` | optional | PDF writer options (page size, orientation, font, page header and footer). |
| `csv` | `readonly csv?: CsvOptions;` | optional | CSV options (delimiter, BOM; `values: 'formatted'` writes the formatted texts instead of the raw numbers). |
| `chart` | `readonly chart?: ExportImage \| readonly ExportImage[];` | optional | 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`. |
| `fileName` | `fileName?: string;` | optional, inherited | File name; the extension is added. Default `export`. |
| `rowLayout` | `rowLayout?: "compact" \| "tabular";` | optional, inherited | `compact` (default): one indented row header column; `tabular`: one column per row level. |
| `rowHeaders` | `rowHeaders?: boolean;` | optional, inherited | Row header columns. Default true. |
| `rowHeaderCaption` | `rowHeaderCaption?: string;` | optional, inherited | Header text of the row header column(s). Default: the row field captions. |
| `rowHeaderWidth` | `rowHeaderWidth?: number;` | optional, inherited | Column widths in CSS px. Defaults 200 (row headers) and 110. |
| `columnWidth` | `columnWidth?: number;` | optional, inherited |  |
| `includeColumn` | `includeColumn?: ((header: PivotExportHeader, index: number) => boolean);` | optional, inherited | Exported value columns (hidden columns, current page only). Default every leaf column. |
| `rowRange` | `rowRange?: readonly [number, number];` | optional, inherited | Exported leaf row positions `[start, end)` (current page only). Default every row. |
| `includeRow` | `includeRow?: ((header: PivotExportHeader, index: number) => boolean);` | optional, inherited | Exported rows. Default every visible leaf row. |
| `pivotStyles` | `pivotStyles?: PivotExportStyles;` | optional, inherited | Subtotal, grand total and row header styles (merged under conditional formats and the hook). |
| `cell` | `cell?: ((ctx: PivotExportCellContext) => void \| ExportCellOverride \| null \| undefined);` | optional, inherited | Per body cell. |
| `headerCell` | `headerCell?: ((ctx: PivotExportHeaderContext) => void \| { readonly text?: string; readonly style?: ExportCellStyle; } \| null \| undefined);` | optional, inherited | Per header cell. |
| `windowCells` | `windowCells?: number;` | optional, inherited | Window sources: cells per `pivot` request while paging. Default 200,000. |
| `locale` | `locale?: string;` | optional, inherited | Locale of the model (number formats in PDF / CSV come from `formattedValue`). |
