[]
Iterable<IPivotTable>IPivotTable objects on a specified worksheet.Use this interface to access existing PivotTable reports on a worksheet or to add new ones through add(IPivotCache,IRange) or add(IPivotCache,IRange,String). An IPivotTables instance is typically obtained from IWorksheet.getPivotTables().
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"A", 100},
{"B", 200}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B3"));
worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "PivotTable1");
IPivotTables pivotTables = worksheet.getPivotTables();
add(IPivotCache PivotCache,
IRange TableDestination) add(IPivotCache PivotCache,
IRange TableDestination,
String TableName) get(int index) IPivotTable at the specified index from the collection.IPivotTable with the specified name from the collection.intgetCount()IPivotTable objects in this collection.forEach, iterator, spliteratorIPivotTable objects in this collection.Use this method to determine how many PivotTable reports are available on the worksheet.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"A", 100},
{"B", 200}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B3"));
worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "PivotTable1");
int count = worksheet.getPivotTables().getCount();
IPivotTable objects in this collection.This overload forwards null as the table name to add(IPivotCache,IRange,String).
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Region", "Sales"},
{"East", 120},
{"West", 150},
{"North", 90}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B4"));
worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"));
PivotCache - The PivotTable cache that provides the source data for the new PivotTable report.TableDestination - The upper-left cell of the destination range where the PivotTable report is placed. The destination range must be on the worksheet that contains this IPivotTables collection.IPivotTable.Creates a PivotTable report from the specified IPivotCache and places it at the specified destination range on the worksheet that contains this IPivotTables collection.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Region", "Product", "Amount"},
{"East", "Apple", 120},
{"West", "Apple", 80},
{"East", "Orange", 90}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:C4"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("E1"), "SalesPivot");
PivotCache - The PivotTable cache on which the new PivotTable report is based. This parameter must not be null.TableDestination - The upper-left cell of the destination range where the PivotTable report is placed. The destination range must be on the worksheet that contains this IPivotTables collection and must not be null.TableName - The name of the new PivotTable report. This value can be null.IPivotTable.IPivotTable at the specified index from the collection.Use this method to retrieve an existing PivotTable report on the current worksheet by its position in the IPivotTables collection.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Region", "Sales"},
{"East", 100},
{"West", 200}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B3"));
worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "SalesPivot");
IPivotTable pivotTable = worksheet.getPivotTables().get(0);
index - The zero-based index of the PivotTable to retrieve.IPivotTable at the specified index in the collection.IPivotTable with the specified name from the collection.Use this method to retrieve an existing PivotTable report on the current worksheet by its name.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Region", "Sales"},
{"East", 100},
{"West", 200}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B3"));
worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "SalesPivot");
IPivotTable pivotTable = worksheet.getPivotTables().get("SalesPivot");
name - The name of the PivotTable to retrieve.IPivotTable with the specified name in the collection.