[]
ISlicer objects.An ISlicers object provides access to the slicers associated with a ISlicerCache. Use it to create slicers, iterate through existing slicers, or retrieve a slicer by index or name.
Object[][] sourceData = new Object[][] {
{"Product", "Category"},
{"Apple", "Fruit"},
{"Carrot", "Vegetable"}
};
worksheet.getRange("A1:B3").setValue(sourceData);
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
ISlicerCache slicerCache = workbook.getSlicerCaches().add(table, "Category", "categoryCache");
ISlicers slicers = slicerCache.getSlicers();
ISlicer slicer = slicers.add(worksheet, "categorySlicer", "Category", 20, 20, 120, 160);
add(IWorksheet slicerDestination,
String name,
String caption,
double top,
double left,
double width,
double height) ISlicer.get(int index) ISlicer with the specified index.ISlicer with the specified name.intgetCount()ISlicer objects in the collection.forEach, iterator, spliteratorISlicer with the specified index.If the slicer's position is known, use this method to retrieve it from the collection.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Amount"},
{"Fruit", 100},
{"Vegetable", 200}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
ISlicerCache cache = workbook.getSlicerCaches().add(table, "Category", "categoryCache");
cache.getSlicers().add(worksheet, "categorySlicer", "Category", 20, 20, 120, 160);
ISlicer slicer = cache.getSlicers().get(0);
index - The index of the slicer to get.ISlicer with the specified index.ISlicer with the specified name.If the slicer's name is known, use this method to retrieve it from the collection.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Amount"},
{"Fruit", 100},
{"Vegetable", 200}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
ISlicerCache cache = workbook.getSlicerCaches().add(table, "Category", "categoryCache");
cache.getSlicers().add(worksheet, "categorySlicer", "Category", 20, 20, 120, 160);
ISlicer slicer = cache.getSlicers().get("categorySlicer");
name - The name of the slicer to get.ISlicer with the specified name.ISlicer objects in the collection.Use this method to determine how many slicers are associated with an ISlicerCache.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Category", "Amount"},
{"Fruit", 100},
{"Vegetable", 200}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
ISlicerCache cache = workbook.getSlicerCaches().add(table, "Category", "categoryCache");
cache.getSlicers().add(worksheet, "categorySlicer", "Category", 20, 20, 120, 160);
int count = cache.getSlicers().getCount();
ISlicer objects in the collection.ISlicer. The slicer is added to this collection and positioned using coordinates measured in points, relative to the upper-left corner of cell A1 on the destination worksheet.
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 cache = workbook.getSlicerCaches().add(table, "Category", "categoryCache");
ISlicer slicer = cache.getSlicers().add(worksheet, "categorySlicer", "Category", 30, 200, 120, 160);
slicerDestination - The IWorksheet on which the slicer is placed. The destination worksheet must belong to the workbook that contains this ISlicers collection.name - The slicer name. This name must be unique across all slicers in the workbook.caption - The caption displayed for the slicer.top - The initial vertical position of the slicer, in points, relative to the upper-left corner of cell A1.left - The initial horizontal position of the slicer, in points, relative to the upper-left corner of cell A1.width - The initial width of the slicer, in points.height - The initial height of the slicer, in points.ISlicer.