[]
Iterable<ISlicerCache>Use this collection to create, retrieve, and enumerate ISlicerCache objects that are based on workbook data sources such as tables.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Category", "Amount"},
{"Fruit", 100},
{"Vegetable", 200},
{"Fruit", 150}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B4"), true);
ISlicerCaches slicerCaches = workbook.getSlicerCaches();
ISlicerCache slicerCache = slicerCaches.add(table, "Category");
ISlicerCache object to the collection.ISlicerCache object to the collection.get(int index) ISlicerCache with the specified index.ISlicerCache with the specified name.intgetCount()forEach, iterator, spliteratorThis method returns the number of ISlicerCache objects in the ISlicerCaches collection associated with a workbook.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Value"},
{"Beverages", 100},
{"Produce", 200}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
workbook.getSlicerCaches().add(table, "Category");
int count = workbook.getSlicerCaches().getCount();
0 if the collection contains no slicer caches.ISlicerCache with the specified index.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Product", "Category"},
{"Apple", "Fruit"},
{"Carrot", "Vegetable"}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
workbook.getSlicerCaches().add(table, "Category", "categoryCache");
ISlicerCache slicerCache = workbook.getSlicerCaches().get(0);
index - The zero-based index of the slicer cache.ISlicerCache at the specified index.ISlicerCache with the specified name.If a slicer cache has already been added to the workbook's ISlicerCaches collection, use this method to retrieve it.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Category", "Amount"},
{"Fruit", 100},
{"Vegetable", 200},
{"Fruit", 150}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B4"), true);
workbook.getSlicerCaches().add(table, "Category", "categoryCache");
ISlicerCache slicerCache = workbook.getSlicerCaches().get("categoryCache");
name - The name of the slicer cache to retrieve.ISlicerCache with the specified name.ISlicerCache object to the collection.Creates a slicer cache based on the specified data source and field. The data source can be a supported object such as a table or PivotTable, and sourceField identifies the field used by the slicer cache.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Category", "Amount"},
{"Fruit", 100},
{"Vegetable", 200},
{"Fruit", 150}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B4"), true);
ISlicerCache slicerCache = workbook.getSlicerCaches().add(table, "Category");
source - The data source that the new ISlicerCache will be based on.sourceField - The name of the field in the data source to filter by.ISlicerCache.ISlicerCache object to the collection.Creates a slicer cache based on the specified data source and field. The name parameter is used to reference the created slicer cache through the ISlicerCache name property.
Object[][] sourceData = new Object[][] {
{"Product", "Category", "Amount"},
{"Apple", "Fruit", 100},
{"Carrot", "Vegetable", 200}
};
worksheet.getRange("A1:C3").setValue(sourceData);
ITable table = worksheet.getTables().add(worksheet.getRange("A1:C3"), true);
ISlicerCache cache = workbook.getSlicerCaches().add(table, "Category", "categoryCache");
source - The data source that the new ISlicerCache will be based on.sourceField - The name of the field in the data source to filter by.name - The name used to reference the slicer cache.ISlicerCache.