com.aspose.cells
Class SlicerCacheItemCollection

java.lang.Object
  extended by CollectionBase
      extended by com.aspose.cells.SlicerCacheItemCollection
All Implemented Interfaces:
java.lang.Iterable

public class SlicerCacheItemCollection 
extends CollectionBase

Represent the collection of SlicerCacheItem

Example:

Workbook book = new Workbook();
Worksheet sheet = book.getWorksheets().get(0);
Cells cells = sheet.getCells();
cells.get(0, 0).setValue("fruit");
cells.get(1, 0).setValue("grape");
cells.get(2, 0).setValue("blueberry");
cells.get(3, 0).setValue("kiwi");
cells.get(4, 0).setValue("cherry");
cells.get(5, 0).setValue("grape");
cells.get(6, 0).setValue("blueberry");
cells.get(7, 0).setValue("kiwi");
cells.get(8, 0).setValue("cherry");
        
cells.get(0, 1).setValue("year");
cells.get(1, 1).setValue(2020);
cells.get(2, 1).setValue(2020);
cells.get(3, 1).setValue(2020);
cells.get(4, 1).setValue(2020);
cells.get(5, 1).setValue(2021);
cells.get(6, 1).setValue(2021);
cells.get(7, 1).setValue(2021);
cells.get(8, 1).setValue(2021);

cells.get(0, 2).setValue("amount");
cells.get(1, 2).setValue(50);
cells.get(2, 2).setValue(60);
cells.get(3, 2).setValue(70);
cells.get(4, 2).setValue(80);
cells.get(5, 2).setValue(90);
cells.get(6, 2).setValue(100);
cells.get(7, 2).setValue(110);
cells.get(8, 2).setValue(120);

PivotTableCollection pivots = sheet.getPivotTables();

int pivotIndex = pivots.add("=Sheet1!A1:C9", "A12", "TestPivotTable");
PivotTable pivot = pivots.get(pivotIndex);
pivot.addFieldToArea(PivotFieldType.ROW, "fruit");
pivot.addFieldToArea(PivotFieldType.COLUMN, "year");
pivot.addFieldToArea(PivotFieldType.DATA, "amount");

pivot.setPivotTableStyleType(PivotTableStyleType.PIVOT_TABLE_STYLE_MEDIUM_10);
pivot.refreshData();
pivot.calculateData();

SlicerCollection slicers = sheet.getSlicers();
int slicerIndex = slicers.add(pivot, "E12", "fruit");
Slicer slicer = slicers.get(slicerIndex);
slicer.setStyleType(SlicerStyleType.SLICER_STYLE_LIGHT_2);

SlicerCacheItemCollection items = slicer.getSlicerCache().getSlicerCacheItems();
//do your business
book.save("out.xlsx");


Property Getters/Setters Summary
intgetCount()
           Gets the count of the SlicerCacheItem.
SlicerCacheItemget(int)
           Gets the SlicerCacheItem object by index.
 
Method Summary
intadd(java.lang.Object value)→ inherited from com.aspose.cells.CollectionBase
          Reserved for internal use.
voidclear()→ inherited from com.aspose.cells.CollectionBase
          
booleancontains(java.lang.Object value)→ inherited from com.aspose.cells.CollectionBase
          Reserved for internal use.
intindexOf(java.lang.Object value)→ inherited from com.aspose.cells.CollectionBase
          Reserved for internal use.
java.util.Iteratoriterator()→ inherited from com.aspose.cells.CollectionBase
          
voidremoveAt(int index)→ inherited from com.aspose.cells.CollectionBase
          
 

Property Getters/Setters Detail

getCount

public int getCount()
Gets the count of the SlicerCacheItem.

Example:

int count = items.getCount();

get

public SlicerCacheItem get(int index)
Gets the SlicerCacheItem object by index.

Example:

SlicerCacheItem item = items.get(0);

Method Detail

clear

→ inherited from com.aspose.cells.CollectionBase
public void clear()

removeAt

→ inherited from com.aspose.cells.CollectionBase
public void removeAt(int index)

iterator

→ inherited from com.aspose.cells.CollectionBase
public java.util.Iterator iterator()

contains

→ inherited from com.aspose.cells.CollectionBase
public boolean contains(java.lang.Object value)
Reserved for internal use.

add

→ inherited from com.aspose.cells.CollectionBase
public int add(java.lang.Object value)
Reserved for internal use.

indexOf

→ inherited from com.aspose.cells.CollectionBase
public int indexOf(java.lang.Object value)
Reserved for internal use.

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.