PivotTableCollection

PivotTableCollection class

Represents the collection of all the PivotTable objects on the specified worksheet.

Methods

NameDescription
add(sourceData, destCellName, tableName)Adds a new PivotTable cache to a PivotCaches collection.
add(sourceData, destCellName, tableName, useSameSource)Adds a new PivotTable cache to a PivotCaches collection.
add(sourceData, row, column, tableName)Adds a new PivotTable cache to a PivotCaches collection.
add(sourceData, row, column, tableName, useSameSource)Adds a new PivotTable cache to a PivotCaches collection.
add()
add()
add(pivotTable, destCellName, tableName)Adds a new PivotTable Object to the collection from another PivotTable.
add(pivotTable, row, column, tableName)Adds a new PivotTable Object to the collection from another PivotTable.
add(sourceData, isAutoPage, pageFields, destCellName, tableName)Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source.
add(sourceData, isAutoPage, pageFields, row, column, tableName)Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source.
add()Reserved for internal use.
clear()Clear all pivot tables.
contains()Reserved for internal use.
dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
get()Gets the PivotTable report by index.
get()Gets the PivotTable report by pivottable’s name.
get()Gets the PivotTable report by pivottable’s position.
get()Reserved for internal use.
getCount()
indexOf()Reserved for internal use.
iterator()
remove(pivotTable)Deletes the specified PivotTable and delete the PivotTable data
remove(pivotTable, keepData)Deletes the specified PivotTable
removeAt(index)Deletes the PivotTable at the specified index and delete the PivotTable data
removeAt(index, keepData)Deletes the PivotTable at the specified index

add(sourceData, destCellName, tableName)

Adds a new PivotTable cache to a PivotCaches collection.

ParameterTypeDescription
sourceDataStringThe data for the new PivotTable cache.
destCellNameStringThe cell in the upper-left corner of the PivotTable report’s destination range.
tableNameStringThe name of the new PivotTable report.

Returns: Number — Number The new added cache index.

add(sourceData, destCellName, tableName, useSameSource)

Adds a new PivotTable cache to a PivotCaches collection.

ParameterTypeDescription
sourceDataStringThe data for the new PivotTable cache.
destCellNameStringThe cell in the upper-left corner of the PivotTable report’s destination range.
tableNameStringThe name of the new PivotTable report.
useSameSourcebooleanIndicates whether using same data source when another existing pivot table has used this data source. If the property is true, it will save memory.

Returns: Number — Number The new added cache index.

add(sourceData, row, column, tableName)

Adds a new PivotTable cache to a PivotCaches collection.

ParameterTypeDescription
sourceDataStringThe data cell range for the new PivotTable.Example : Sheet1!A1:C8
rowNumberRow index of the cell in the upper-left corner of the PivotTable report’s destination range.
columnNumberColumn index of the cell in the upper-left corner of the PivotTable report’s destination range.
tableNameStringThe name of the new PivotTable report.

Returns: Number — Number The new added cache index.

add(sourceData, row, column, tableName, useSameSource)

Adds a new PivotTable cache to a PivotCaches collection.

ParameterTypeDescription
sourceDataStringThe data cell range for the new PivotTable.Example : Sheet1!A1:C8
rowNumberRow index of the cell in the upper-left corner of the PivotTable report’s destination range.
columnNumberColumn index of the cell in the upper-left corner of the PivotTable report’s destination range.
tableNameStringThe name of the new PivotTable report.
useSameSourcebooleanIndicates whether using same data source when another existing pivot table has used this data source. If the property is true, it will save memory.

Returns: Number — Number The new added cache index.

add()

add()

add(pivotTable, destCellName, tableName)

Adds a new PivotTable Object to the collection from another PivotTable.

ParameterTypeDescription
pivotTablePivotTableThe source pivotTable.
destCellNameStringThe cell in the upper-left corner of the PivotTable report’s destination range.
tableNameStringThe name of the new PivotTable report.

Returns: Number — Number The new added PivotTable index.

add(pivotTable, row, column, tableName)

Adds a new PivotTable Object to the collection from another PivotTable.

ParameterTypeDescription
pivotTablePivotTableThe source pivotTable.
rowNumberRow index of the cell in the upper-left corner of the PivotTable report’s destination range.
columnNumberColumn index of the cell in the upper-left corner of the PivotTable report’s destination range.
tableNameStringThe name of the new PivotTable report.

Returns: Number — Number The new added PivotTable index.

add(sourceData, isAutoPage, pageFields, destCellName, tableName)

Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source.

ParameterTypeDescription
sourceDataArray of StringThe multiple consolidation ranges,such as {“Sheet1!A1:C8”,“Sheet2!A1:B8”}
isAutoPagebooleanWhether auto create a single page field. If true,the following param pageFields will be ignored.
pageFieldsPivotPageFieldsThe pivot page field items.
destCellNameStringdestCellName The name of the new PivotTable report.
tableNameStringthe name of the new PivotTable report.

Returns: Number — Number The new added PivotTable index.

add(sourceData, isAutoPage, pageFields, row, column, tableName)

Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source.

ParameterTypeDescription
sourceDataArray of StringThe multiple consolidation ranges,such as {“Sheet1!A1:C8”,“Sheet2!A1:B8”}
isAutoPagebooleanWhether auto create a single page field. If true,the following param pageFields will be ignored
pageFieldsPivotPageFieldsThe pivot page field items.
rowNumberRow index of the cell in the upper-left corner of the PivotTable report’s destination range.
columnNumberColumn index of the cell in the upper-left corner of the PivotTable report’s destination range.
tableNameStringThe name of the new PivotTable report.

Returns: Number — Number The new added PivotTable index.

add()

Reserved for internal use.

clear()

Clear all pivot tables.

contains()

Reserved for internal use.

dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

get()

Gets the PivotTable report by index.

get()

Gets the PivotTable report by pivottable’s name.

get()

Gets the PivotTable report by pivottable’s position.

get()

Reserved for internal use.

getCount()

indexOf()

Reserved for internal use.

iterator()

remove(pivotTable)

Deletes the specified PivotTable and delete the PivotTable data

ParameterTypeDescription
pivotTablePivotTablePivotTable object

remove(pivotTable, keepData)

Deletes the specified PivotTable

ParameterTypeDescription
pivotTablePivotTablePivotTable object
keepDatabooleanWhether to keep the PivotTable data

removeAt(index)

Deletes the PivotTable at the specified index and delete the PivotTable data

ParameterTypeDescription
indexNumberthe position index in PivotTable collection

removeAt(index, keepData)

Deletes the PivotTable at the specified index

ParameterTypeDescription
indexNumberthe position index in PivotTable collection
keepDatabooleanWhether to keep the PivotTable data