PivotTableCollection
PivotTableCollection class
Represents the collection of all the PivotTable objects on the specified worksheet.
Properties
| Name | Type | Description |
|---|---|---|
| Count | int | |
| Item (int) | PivotTable | Gets the PivotTable report by index. |
| Item (java.lang.String) | PivotTable | Gets the PivotTable report by pivottable’s name. |
| Item (int, int) | PivotTable | Gets the PivotTable report by pivottable’s position. |
Methods
| Name | Description |
|---|---|
| dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
| add | Adds a new PivotTable cache to a PivotCaches collection. |
| clear | Clear all pivot tables. |
| remove | Deletes the specified PivotTable and delete the PivotTable data |
| removeAt | Deletes the PivotTable at the specified index and delete the PivotTable data |
| iterator | |
| get | Reserved for internal use. |
| contains | Reserved for internal use. |
| indexOf | Reserved for internal use. |
PivotTableCollection.Count property
Type: int
PivotTableCollection.Item (int) property
Gets the PivotTable report by index.
Type: PivotTable
PivotTableCollection.Item (java.lang.String) property
Gets the PivotTable report by pivottable’s name.
Type: PivotTable
PivotTableCollection.Item (int, int) property
Gets the PivotTable report by pivottable’s position.
Type: PivotTable
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
add(sourceData, destCellName, tableName) (1 of 11)
Adds a new PivotTable cache to a PivotCaches collection.
| 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(sourceData, destCellName, tableName, useSameSource) (2 of 11)
Adds a new PivotTable cache to a PivotCaches collection.
| 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(sourceData, row, column, tableName) (3 of 11)
Adds a new PivotTable cache to a PivotCaches collection.
| Parameter | Type | Description |
|---|---|---|
| sourceData | String | The data cell range for the new PivotTable.Example : Sheet1!A1:C8 |
| row | int | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
| column | int | 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(sourceData, row, column, tableName, useSameSource) (4 of 11)
Adds a new PivotTable cache to a PivotCaches collection.
| Parameter | Type | Description |
|---|---|---|
| sourceData | String | The data cell range for the new PivotTable.Example : Sheet1!A1:C8 |
| row | int | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
| column | int | 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(sourceData, row, column, tableName, useSameSource, isXlsClassic) (5 of 11)
add(sourceData, cell, tableName, useSameSource, isXlsClassic) (6 of 11)
add(pivotTable, destCellName, tableName) (7 of 11)
Adds a new PivotTable Object to the collection from another PivotTable.
| 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, row, column, tableName) (8 of 11)
Adds a new PivotTable Object to the collection from another PivotTable.
| Parameter | Type | Description |
|---|---|---|
| pivotTable | PivotTable | The source pivotTable. |
| row | int | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
| column | int | 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(sourceData, isAutoPage, pageFields, destCellName, tableName) (9 of 11)
Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source.
| 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(sourceData, isAutoPage, pageFields, row, column, tableName) (10 of 11)
Adds a new PivotTable Object to the collection with multiple consolidation ranges as data source.
| 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 | int | Row index of the cell in the upper-left corner of the PivotTable report’s destination range. |
| column | int | 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(value) (11 of 11)
Reserved for internal use.
clear()
Clear all pivot tables.
remove(pivotTable) (1 of 2)
Deletes the specified PivotTable and delete the PivotTable data
| Parameter | Type | Description |
|---|---|---|
| pivotTable | PivotTable | PivotTable object |
remove(pivotTable, keepData) (2 of 2)
Deletes the specified PivotTable
| Parameter | Type | Description |
|---|---|---|
| pivotTable | PivotTable | PivotTable object |
| keepData | boolean | Whether to keep the PivotTable data |
removeAt(index) (1 of 2)
Deletes the PivotTable at the specified index and delete the PivotTable data
| Parameter | Type | Description |
|---|---|---|
| index | int | the position index in PivotTable collection |
removeAt(index, keepData) (2 of 2)
Deletes the PivotTable at the specified index
| Parameter | Type | Description |
|---|---|---|
| index | int | the position index in PivotTable collection |
| keepData | boolean | Whether to keep the PivotTable data |
iterator()
get(index)
Reserved for internal use.
contains(value)
Reserved for internal use.
indexOf(value)
Reserved for internal use.