modern-xlsx API Reference - v1.3.0
    Preparing search index...

    Interface PivotFieldData

    A <pivotField>: a field of the pivot table and the area (axis) it is placed in. Its showAll, sortType and numFmtId attributes are dropped on read.

    interface PivotFieldData {
        axis?: PivotAxis;
        compact: boolean;
        dataField?: boolean;
        defaultSubtotal?: boolean | null;
        items: PivotItem[];
        name?: string;
        outline: boolean;
        subtotals: SubtotalFunction[];
    }
    Index
    axis?: PivotAxis
    compact: boolean
    dataField?: boolean

    true when the field is used as a data (values) field, with or without an axis.

    defaultSubtotal?: boolean | null

    defaultSubtotal. false shows no subtotal for the field; when unset Excel's automatic subtotal applies, also when subtotals is empty.

    items: PivotItem[]

    The field's <item>s. Excel saves every row, column and page field with items; an empty list on such a field marks a field built in code, and the writer then writes the items Excel needs to refresh the table: one { x } per shared item of the cache field at the same index, then the subtotal items ({ t: 'default' }, or one per function in subtotals, none when defaultSubtotal is false). The model is not changed. A non-empty list is written as given. The write throws (SIZE_LIMIT) when a field would get more than 1,048,576 such items, or the workbook's tables more than 4,194,304 items and empty fields in all; explicit items are not counted.

    name?: string
    outline: boolean
    subtotals: SubtotalFunction[]

    The functions whose *Subtotal="1" flag is set.