ApiPivotTable

class ApiPivotTable

Description

Class representing a PivotTable.

Instance Methods

AddDataField(field): ApiPivotDataField

Adds a data field to a PivotTable report.

AddFields(options, options.rows, options.columns, options.pages, options.addToTable)

Adds row, column, and page fields to a PivotTable report.

ClearAllFilters()

Deletes all filters currently applied to the PivotTable.

ClearTable()

Clears the Pivot Table.

GetData(items): number | "null"

Returns the value for the data filed in a PivotTable.

GetPivotData(dataField, fieldItemsArray): ApiRange

Returns a Range object with information about a data item in a PivotTable report.

GetPivotFields(field): ApiPivotField[] | ApiPivotField | ApiPivotDataField | "null"

Returns an collection that represents either a single PivotTable field or a collection of both the visible and hidden fields in the PivotTable report.

PivotValueCell(rowLine, colLine): number | string | "null"

Returns the value of a pivot table cell.

ShowDetails(rowLine, colLine): boolean

Show details of pivot cell.

RefreshTable()

Refreshes the PivotTable report from the source data.

Update()

Updates the PivotTable.

SetRepeatAllLabels(repeat)

Specifies whether to repeat item labels for all PivotFields in the specified PivotTable.

SetRowAxisLayout(type, compact)

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

SetSubtotalLocation(type)

Sets PivotTable setting layout subtotal location.

RemoveField(identifier)

Removes field from all PivotTable categories.

MoveField(identifier, type, index)

Moves field from one category to another.

Select()

Selects the PivotTable.

GetColumnFields(): ApiPivotField[]

Returns an collection that represents a collection of all column fields.

GetDataFields(field): ApiPivotDataField[] | ApiPivotDataField | "null"

Returns an collection that represents either a single PivotTable data field or a collection of all visible data fields.

GetHiddenFields(): ApiPivotField[]

Returns array that represents all not added fields in PivotTable.

GetVisibleFields(): ApiPivotField[]

Returns array that represents all added fields in PivotTable.

GetPageFields(): ApiPivotField[]

Returns an collection that represents either a single PivotTable page field or a collection of all visible page fields.

GetRowFields(): ApiPivotField[]

Returns an collection that represents a collection of all row fields.

GetName(): string

Returns name of the PivotTable.

SetName(name)

Sets name of the PivotTable.

GetColumnGrand(): boolean

Returns PivotTable Grand Totals settings for columns.

SetColumnGrand(show)

Sets PivotTable Grand Totals settings for columns.

GetRowGrand(): boolean

Returns PivotTable Grand Totals settings for rows.

SetRowGrand(show)

Sets PivotTable Grand Totals settings for rows.

GetDisplayFieldsInReportFilterArea(): any

Returns PivotTable display fields in report filter area settings.

SetDisplayFieldsInReportFilterArea(type, fields)

Returns PivotTable display fields in report filter area settings.

GetDisplayFieldCaptions(): boolean

Returns PivotTable setting show field headers for rows and columns.

SetDisplayFieldCaptions(show)

Sets show field headers for rows and columns.

GetTitle(): string

Returns the title of the PivotTable.

SetTitle(title)

Sets the title of the PivotTable.

GetDescription(): string

Returns the description of the PivotTable.

SetDescription(description)

Sets the description of the PivotTable.

GetStyleName(): string

Returns the style name of the PivotTable.

SetStyleName(name)

Sets the style of the PivotTable.

GetTableStyleRowHeaders(): boolean

Returns the row headers style for PivotTable.

SetTableStyleRowHeaders(show)

Sets the row headers style for PivotTable.

GetTableStyleColumnHeaders(): boolean

Returns the column headers style for PivotTable.

SetTableStyleColumnHeaders(show)

Sets the column headers style for PivotTable.

GetTableStyleRowStripes(): boolean

Returns the banded rows style for PivotTable.

SetTableStyleRowStripes(show)

Sets the banded rows style for PivotTable.

GetTableStyleColumnStripes(): boolean

Returns the banded columns style for PivotTable.

SetTableStyleColumnStripes(show)

Sets the banded columns style for PivotTable.

GetSource(): ApiRange

Returns source for the PivotTable.

SetSource(source)

Sets source for the PivotTable.

GetColumnRange(): ApiRange | "null"

Returns a Range object that represents the range that contains the column area in the PivotTable report.

GetRowRange(): ApiRange | "null"

Returns a Range object that represents the range that contains the row area in the PivotTable report.

GetDataBodyRange(): ApiRange

Returns a Range object that represents the range of values in a PivotTable.

GetTableRange1(): ApiRange | "null"

Returns a Range object that represents the range containing the entire PivotTable report, but doesn't include page fields.

GetTableRange2(): ApiRange | "null"

Returns a Range object that represents the range containing the entire PivotTable report, including page fields.

GetGrandTotalName(): string

Returns the text string label that is displayed in the grand total column or row heading in the specified PivotTable report.

SetGrandTotalName(name)

Sets the text string label that is displayed in the grand total column or row heading in the specified PivotTable report.

SetLayoutBlankLine(insert)

Sets PivotTable setting insert blank rows after each item.

SetLayoutSubtotals(show)

Sets PivotTable setting show subtotals.

GetParent(): ApiWorksheet

Returns Pivot Table parent.

Instance Properties

Namestring

Returns or sets name of the PivotTable.

ColumnGrandboolean

Returns or sets PivotTable Grand Totals settings for columns.

RowGrandboolean

Returns or sets PivotTable Grand Totals settings for rows.

DisplayFieldCaptionsboolean

Returns or set show field headers for rows and columns.

Titlestring

Returns or sets the title of the PivotTable.

Descriptionstring

Returns or sets the description of the PivotTable.

StyleNamestring

Returns or sets the style name of the PivotTable.

ShowTableStyleRowHeadersboolean

Returns or sets the row headers style for PivotTable.

ShowTableStyleColumnHeadersboolean

Returns or sets the column headers style for PivotTable.

ShowTableStyleRowStripesboolean

Returns or sets the banded rows style for PivotTable.

ShowTableStyleColumnStripesboolean

Returns or sets the banded columns style for PivotTable.

SourceApiRange

Returns or sets source for the PivotTable.

ColumnRangeApiRange | "null"

Returns a Range object that represents the range that contains the column area in the PivotTable report.

RowRangeApiRange | "null"

Returns a Range object that represents the range that contains the row area in the PivotTable report.

DataBodyRangeApiRange

Returns a Range object that represents the range of values in a PivotTable.

TableRange1ApiRange | "null"

Returns a Range object that represents the range containing the entire PivotTable report, but doesn't include page fields.

TableRange2ApiRange | "null"

Returns a Range object that represents the range containing the entire PivotTable report, including page fields.

GrandTotalNamestring

Sets the text string label that is displayed in the grand total column or row heading in the specified PivotTable report.

RepeatAllLabelsboolean

Specifies whether to repeat item labels for all PivotFields in the specified PivotTable.

RowAxisLayoutobject

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

LayoutBlankLineboolean

Sets PivotTable setting insert blank rows after each item.

LayoutSubtotalsboolean

Sets PivotTable setting show subtotals.

SubtotalLocationnumber

Sets PivotTable setting layout subtotal location.

PivotFieldsApiPivotField[]

Returns all PivotFields in PivotTable.

ColumnFieldsApiPivotField[]

Returns array that are currently showing as column fields in PivotTable.

DataFieldsApiPivotField[]

Returns array that are currently showing values fields in PivotTable.

HiddenFieldsApiPivotField[]

Returns array that represents all not added fields in PivotTable.

VisibleFieldsApiPivotField[]

Returns array that represents all not added fields in PivotTable.

PageFieldsApiPivotField[]

Returns array that are currently showing as page fields in PivotTable.

RowFieldsApiPivotField[]

Returns array that are currently showing as row fields in PivotTable.

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).