ApiPivotField

class ApiPivotField

Description

Class representing a PivotTable field.

Instance Methods

ClearAllFilters()

Calling this method deletes all filters currently applied to the PivotField.

ClearLabelFilters()

This method deletes all label filters or all date filters in the PivotFilters collection.

ClearManualFilters()
ClearValueFilters()

Calling this method deletes all value filters in the PivotFilters collection of the PivotField.

GetPivotItems(index): ApiPivotItem[] | ApiPivotItem | "null"

Returns an object that represents either a single PivotTable item (a PivotItem object) or a collection of all the visible and hidden items (a PivotItems object) in the specified field.

Move(type, index)

Moves field inside category.

Remove()

Removes field from PivotTable.

GetPosition(): number

Returns a value that represents the position of the field in category.

SetPosition(position)

Sets a value that represents the position of the field among all the fields in its orientation (Rows, Columns, Pages).

GetOrientation(): PivotFieldOrientationType

Returns a pivot field orientation value that represents the location of the field in the specified PivotTable report.

SetOrientation(type)

Sets a pivot field orientation value that represents the location of the field in the specified PivotTable report.

GetValue(): string

Returns a value representing the name of the object.

SetValue(name)

Sets a value representing the name of the object.

GetCaption(): string

Returns a value that represents the label text for the pivot field.

SetCaption(caption)

Set value that represents the label text for the pivot field.

GetName(): string

Returns a value representing the name of the object.

SetName(name)

Sets a value representing the name of the object.

GetSourceName(): string

Returns source name.

GetIndex(): number

Returns index of the PivotField.

GetTable(): ApiPivotTable

Returns ApiPivotTable.

GetParent(): ApiPivotTable

Returns parent object to this field.

GetLayoutCompactRow(): boolean

Returns whether or not a PivotField is compacted.

SetLayoutCompactRow(compact)

Sets whether or not a PivotField is compacted.

GetLayoutForm(): PivotLayoutType

Returns the way the specified PivotTable items appear—in table format or in outline format.

SetLayoutForm(type)

Sets the way the specified PivotTable items appear—in table format or in outline format.

GetLayoutPageBreak(): boolean

Returns the flag that represents page break is inserted after each field.

SetLayoutPageBreak(insert)

Sets the flag that represents page break is inserted after each field.

GetShowingInAxis(): boolean

Returns if the PivotField is currently visible in the PivotTable or not.

GetRepeatLabels(): boolean

Returns setting repeat items labels at each row.

SetRepeatLabels(repeat)

Sets setting repeat items labels at each row.

GetLayoutBlankLine(): boolean

Returns setting insert blank rows after each item.

SetLayoutBlankLine(insert)

Sets setting insert blank rows after each item.

GetShowAllItems(): boolean

Returns setting show items with no data.

SetShowAllItems(show)

Sets setting show items with no data.

GetLayoutSubtotals(): boolean

Returns setting show subtotals.

SetLayoutSubtotals(show)

Set setting show subtotals.

GetLayoutSubtotalLocation(): LayoutSubtotalLocationType

Returns setting layout subtotal location.

SetLayoutSubtotalLocation(type)

Sets setting layout subtotal location.

GetSubtotalName(): string

Returns the text string label displayed in the subtotal column or row heading in the specified PivotTable report.

SetSubtotalName(caption)

Sets the text string label displayed in the subtotal column or row heading in the specified PivotTable report.

GetSubtotals(): PivotFieldSubtotals

Returns object that represent all subtotals.

SetSubtotals(subtotals)

Sets Subtotals.

GetDragToColumn(): boolean

Returns the specified field, can be dragged to the column position or not.

SetDragToColumn(flag)

Sets the specified field, can be dragged to the column position or not.

GetDragToRow(): boolean

Returns the specified field, can be dragged to the row position or not.

SetDragToRow(flag)

Sets the specified field, can be dragged to the row position or not.

GetDragToData(): boolean

Returns the specified field, can be dragged to the data position or not.

SetDragToData(flag)

Sets the specified field, can be dragged to the data position or not.

GetDragToPage(): boolean

Returns the specified field, can be dragged to the page position or not.

SetDragToPage(flag)

Sets the specified field, can be dragged to the page position or not.

GetCurrentPage(): string | number

Returns the current page showing for the page field (valid only for page fields).

Instance Properties

Positionnumber

Returns or sets a value that represents the position of the field (first, second, third, and so on) among all the fields in its orientation (Rows, Columns, Pages, Data).

Orientationnumber

A pivot field orientation value that represents the location of the field in the specified PivotTable report.

Captionstring

Returns or sets a value that represents the label text for the pivot field.

Namestring

Returns or sets a value representing the name of the object.

Valuestring

Returns or sets a value representing the name of the object.

SourceNamestring

Returns source name.

Indexnumber

Returns index.

TableApiPivotTable

Returns ApiPivotField.

ParentApiPivotTable

Returns parent object to this field.

LayoutCompactRowboolean

Returns or sets whether or not a PivotField is compacted.

LayoutFormnumber

Returns or sets the way the specified PivotTable items appear—in table format or in outline format.

LayoutPageBreakboolean

Returns or set the flag that represents page break is inserted after each field.

ShowingInAxisboolean

Returns if the PivotField is currently visible in the PivotTable or not.

RepeatLabelsboolean

setting repeat items labels at each row.

LayoutBlankLineboolean

Returns or sets setting insert blank rows after each item.

ShowAllItemsboolean

Returns or sets setting show items with no data.

LayoutSubtotalsboolean

Returns or sets setting show subtotals.

LayoutSubtotalLocationnumber

Returns or sets setting layout subtotal location.

SubtotalNamestring

Returns or sets text string label displayed in the subtotal column or row heading in the specified PivotTable report.

Subtotalsobject

Returns or sets subtotals.

Formulanumber

Returns or sets a value that represents the object's formula.

DragToColumnboolean

Returns or sets the specified field, can be dragged to the column position or not.

DragToRowboolean

Returns or sets the specified field, can be dragged to the row position or not.

DragToDataboolean

Returns or sets the specified field, can be dragged to the data position or not.

DragToPageboolean

Returns or sets the specified field, can be dragged to the page position or not.

NumberFormatstring | "null"

Returns or sets a value that represents the format code for the object.

CurrentPagestring | number

Returns the current page showing for the page field (valid only for page fields).

Extends By

ApiPivotDataFieldApiPivotField

Class representing a PivotTable data field.

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).