PivotTableCollection
PivotTableCollection class
Represents the collection of all the PivotTable objects on the specified worksheet.
class PivotTableCollection;
Methods
Method | Description |
---|---|
get(number) | Gets the PivotTable report by index. |
get(string) | Gets the PivotTable report by pivottable’s name. |
get(number, number) | Gets the PivotTable report by pivottable’s position. |
dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
add(string, string, string) | Adds a new PivotTable. |
add(string, string, string, boolean) | Adds a new PivotTable. |
add(string, number, number, string) | Adds a new PivotTable. |
add(string, number, number, string, boolean) | Adds a new PivotTable. |
add(string, number, number, string, boolean, boolean) | Adds a new PivotTable. |
add(string, string, string, boolean, boolean) | Adds a new PivotTable. |
add(PivotTable, string, string) | Adds a new PivotTable based on another PivotTable. |
add(PivotTable, number, number, string) | Adds a new PivotTable based on another PivotTable. |
add(string[], boolean, PivotPageFields, string, string) | Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source. |
add(string[], boolean, PivotPageFields, number, number, string) | Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source. |
clear() | Clear all pivot tables. |
remove(PivotTable) | Deletes the specified PivotTable and delete the PivotTable data |
remove(PivotTable, boolean) | Deletes the specified PivotTable |
removeAt(number) | Deletes the PivotTable at the specified index and delete the PivotTable data |
removeAt(number, boolean) | Deletes the PivotTable at the specified index |
getCount() | Gets the number of elements contained in. |
isNull() | Checks whether the implementation object is null. |
get(number)
Gets the PivotTable report by index.
get(index: number) : PivotTable;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number |
Returns
get(string)
Gets the PivotTable report by pivottable’s name.
get(name: string) : PivotTable;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string |
Returns
get(number, number)
Gets the PivotTable report by pivottable’s position.
get(row: number, column: number) : PivotTable;
Parameters:
Parameter | Type | Description |
---|---|---|
row | number | |
column | number |
Returns
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose() : void;
add(string, string, string)
Adds a new PivotTable.
add(sourceData: string, destCellName: string, tableName: string) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceData | string | The data for the new PivotTable cache. |
destCellName | string | The cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
Returns
The new added cache index.
add(string, string, string, boolean)
Adds a new PivotTable.
add(sourceData: string, destCellName: string, tableName: string, useSameSource: boolean) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceData | string | The data for the new PivotTable cache. |
destCellName | string | The cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
useSameSource | boolean | Indicates 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
The new added cache index.
add(string, number, number, string)
Adds a new PivotTable.
add(sourceData: string, row: number, column: number, tableName: string) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceData | string | The data cell range for the new PivotTable.Example : Sheet1!A1:C8 |
row | number | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
column | number | Column index of the cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
Returns
The new added cache index.
add(string, number, number, string, boolean)
Adds a new PivotTable.
add(sourceData: string, row: number, column: number, tableName: string, useSameSource: boolean) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceData | string | The data cell range for the new PivotTable.Example : Sheet1!A1:C8 |
row | number | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
column | number | Column index of the cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
useSameSource | boolean | Indicates 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
The new added cache index.
add(string, number, number, string, boolean, boolean)
Adds a new PivotTable.
add(sourceData: string, row: number, column: number, tableName: string, useSameSource: boolean, isXlsClassic: boolean) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceData | string | The data cell range for the new PivotTable.Example : Sheet1!A1:C8 |
row | number | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
column | number | Column index of the cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
useSameSource | boolean | Indicates whether using same data source when another existing pivot table has used this data source. /// If the property is true, it will save memory. |
isXlsClassic | boolean | Indicates whether add classic pivot table of Excel 97-2003. |
Returns
The new added cache index.
add(string, string, string, boolean, boolean)
Adds a new PivotTable.
add(sourceData: string, cell: string, tableName: string, useSameSource: boolean, isXlsClassic: boolean) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceData | string | The data cell range for the new PivotTable.Example : Sheet1!A1:C8 |
cell | string | The cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
useSameSource | boolean | Indicates whether using same data source when another existing pivot table has used this data source. /// If the property is true, it will save memory. |
isXlsClassic | boolean | Indicates whether add classic pivot table of Excel 97-2003. |
Returns
The new added cache index.
add(PivotTable, string, string)
Adds a new PivotTable based on another PivotTable.
add(pivotTable: PivotTable, destCellName: string, tableName: string) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
pivotTable | PivotTable | The source pivotTable. |
destCellName | string | The cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
Returns
The new added PivotTable index.
add(PivotTable, number, number, string)
Adds a new PivotTable based on another PivotTable.
add(pivotTable: PivotTable, row: number, column: number, tableName: string) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
pivotTable | PivotTable | The source pivotTable. |
row | number | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
column | number | Column index of the cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
Returns
The new added PivotTable index.
add(string[], boolean, PivotPageFields, string, string)
Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source.
add(sourceData: string[], isAutoPage: boolean, pageFields: PivotPageFields, destCellName: string, tableName: string) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceData | string[] | The multiple consolidation ranges,such as {“Sheet1!A1:C8”,“Sheet2!A1:B8”} |
isAutoPage | boolean | Whether auto create a single page field. /// If true,the following param pageFields will be ignored. |
pageFields | PivotPageFields | The pivot page field items. |
destCellName | string | destCellName The name of the new PivotTable report. |
tableName | string | the name of the new PivotTable report. |
Returns
The new added PivotTable index.
add(string[], boolean, PivotPageFields, number, number, string)
Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source.
add(sourceData: string[], isAutoPage: boolean, pageFields: PivotPageFields, row: number, column: number, tableName: string) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceData | string[] | The multiple consolidation ranges,such as {“Sheet1!A1:C8”,“Sheet2!A1:B8”} |
isAutoPage | boolean | Whether auto create a single page field. /// If true,the following param pageFields will be ignored |
pageFields | PivotPageFields | The pivot page field items. |
row | number | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
column | number | Column index of the cell in the upper-left corner of the PivotTable report’s destination range. |
tableName | string | The name of the new PivotTable report. |
Returns
The new added PivotTable index.
clear()
Clear all pivot tables.
clear() : void;
remove(PivotTable)
Deletes the specified PivotTable and delete the PivotTable data
remove(pivotTable: PivotTable) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
pivotTable | PivotTable | PivotTable object |
remove(PivotTable, boolean)
Deletes the specified PivotTable
remove(pivotTable: PivotTable, keepData: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
pivotTable | PivotTable | PivotTable object |
keepData | boolean | Whether to keep the PivotTable data |
removeAt(number)
Deletes the PivotTable at the specified index and delete the PivotTable data
removeAt(index: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number | the position index in PivotTable collection |
removeAt(number, boolean)
Deletes the PivotTable at the specified index
removeAt(index: number, keepData: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number | the position index in PivotTable collection |
keepData | boolean | Whether to keep the PivotTable data |
getCount()
Gets the number of elements contained in.
getCount() : number;
isNull()
Checks whether the implementation object is null.
isNull() : boolean;