[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.PivotItems

PivotItems Property

PivotItems

Gets the collection of all visible and hidden items in this PivotTable field.

Use this collection to access individual field items, including items that are currently hidden by manual filtering.

Declaration
IPivotItems PivotItems { get; }
ReadOnly Property PivotItems As IPivotItems
Examples
object[,] sourceData = {
    {"Region", "Amount"},
    {"North", 100},
    {"South", 200},
    {"East", 150}
};
worksheet.Range["A1:B4"].Value = sourceData;
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "salesPivot");
IPivotField field = pivotTable.PivotFields["Region"];
field.Orientation = PivotFieldOrientation.RowField;
IPivotItems items = field.PivotItems;
items["North"].Visible = false;