[]
Iterable<IPivotCache>An IPivotCaches collection provides access to all IPivotCache objects in the workbook. Use this interface to retrieve an existing cache by index, get the number of caches, or create a new cache from a worksheet range or table before creating PivotTable reports.
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Product", "Category", "Amount"},
{"Carrots", "Vegetables", 1200},
{"Broccoli", "Vegetables", 850},
{"Bananas", "Fruit", 640}
});
IPivotCaches pivotCaches = workbook.getPivotCaches();
IPivotCache pivotCache = pivotCaches.create(worksheet.getRange("A1:C4"));
get(int index) IPivotCache at the specified index.intgetCount()IPivotCache objects in this collection.forEach, iterator, spliteratorIPivotCache objects in this collection.Use this method to determine how many PivotTable caches are currently available in the workbook.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Product", "Amount"},
{"Apple", 100},
{"Banana", 200}
});
worksheet.getRange("D1:E3").setValue(new Object[][] {
{"Region", "Sales"},
{"East", 300},
{"West", 250}
});
IPivotCaches pivotCaches = workbook.getPivotCaches();
pivotCaches.create(worksheet.getRange("A1:B3"));
pivotCaches.create(worksheet.getRange("D1:E3"));
int count = pivotCaches.getCount();
IPivotCache at the specified index.Use this method to retrieve a PivotCache from the workbook's IPivotCaches collection after it has been created with create(Object).
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Amount"},
{"Beverages", 100},
{"Snacks", 200}
});
IPivotCaches pivotCaches = workbook.getPivotCaches();
pivotCaches.create(worksheet.getRange("A1:B3"));
IPivotCache pivotCache = pivotCaches.get(0);
index - The index of the PivotCache to retrieve.IPivotCache at the specified index.Use this method to build a PivotCache that can later be used to create a PivotTable. The source data must be an IRange or an ITable.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Region", "Sales"},
{"East", 120},
{"West", 150},
{"East", 90}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B4"));
SourceData - The source data for the new PivotCache. This must be an IRange or an ITable; null is not supported.IPivotCache created from the specified source data.IllegalArgumentException - If SourceData is not an IRange or an ITable.