[]
Iterable<IPivotTable>IPivotTable objects associated with a specified ISlicerCache. Use this collection to inspect, add, or remove PivotTable references controlled by the slicer cache.
IRange source = worksheet.getRange("A1:B3");
source.setValue(new Object[][] {
{"Product", "Amount"},
{"A", 10},
{"B", 20}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(source);
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "PivotTable1");
ISlicerCache cache = workbook.getSlicerCaches().add(pivotTable, "Product");
ISlicerPivotTables pivotTables = cache.getPivotTables();
int count = pivotTables.getCount();
voidaddPivotTable(IPivotTable pivotTable) get(int index) intgetCount()voidremovePivotTable(IPivotTable pivotTable) forEach, iterator, spliterator
worksheet.getRange("A1:B3").setValue(new Object[][] {{"Product", "Amount"}, {"A", 10}, {"B", 20}});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B3"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "PivotTable1");
ISlicerCache cache = workbook.getSlicerCaches().add(pivotTable, "Product");
IPivotTable firstPivotTable = cache.getPivotTables().get(0);
index - The index of the PivotTable reference in the slicer cache, starting at 0.
worksheet.getRange("A1:B3").setValue(new Object[][] {{"Product", "Amount"}, {"A", 10}, {"B", 20}});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B3"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "PivotTable1");
ISlicerCache cache = workbook.getSlicerCaches().add(pivotTable, "Product");
int count = cache.getPivotTables().getCount();
worksheet.getRange("A1:B3").setValue(new Object[][] {{"Product", "Amount"}, {"A", 10}, {"B", 20}});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B3"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "PivotTable1");
ISlicerCache cache = workbook.getSlicerCaches().add(pivotTable, "Product");
IPivotTable anotherPivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("H1"), "PivotTable2");
cache.getPivotTables().addPivotTable(anotherPivotTable);
pivotTable - The PivotTable to add to the association list for the slicer cache.
worksheet.getRange("A1:B3").setValue(new Object[][] {{"Product", "Amount"}, {"A", 10}, {"B", 20}});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B3"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "PivotTable1");
ISlicerCache cache = workbook.getSlicerCaches().add(pivotTable, "Product");
cache.getPivotTables().removePivotTable(pivotTable);
pivotTable - The specified PivotTable to remove from the slicer cache association list.