[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotItemList

IPivotItemList Interface

Represents a collection of IPivotItem objects in a PivotTable field.

This interface provides access to the PivotTable items that belong to a field. Each item represents a distinct entry in the field and can be enumerated by using the inherited IEnumerable support. This interface is typically obtained from PivotItems.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IPivotItemList : IEnumerable<IPivotItem>, IEnumerable
Public Interface IPivotItemList
    Inherits IEnumerable(Of IPivotItem), IEnumerable
Examples
worksheet.Range["A1:C4"].Value = new object[,] {
    {"Category", "Product", "Amount"},
    {"Fruit", "Apple", 100},
    {"Fruit", "Orange", 200},
    {"Vegetable", "Carrot", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "pivotTable1");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IPivotValueCell valueCell = pivotTable.PivotValueCell(0, 0);
IPivotCell pivotCell = valueCell.PivotCell;
IPivotItemList rowItems = pivotCell.RowItems;

Properties

Name Description
Count

Gets the number of pivot items in this list.

This property returns the number of IPivotItem objects contained in the current IPivotItemList.

this[int]

Gets the pivot item at the specified index in this list.