[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotFields

IPivotFields Interface

Represents the collection of IPivotField objects in a PivotTable report.

An IPivotFields collection contains all fields that belong to a PivotTable report, including fields that are not currently visible in the layout. Use this interface to enumerate fields or retrieve a field by index or by name.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IPivotFields : IEnumerable<IPivotField>, IEnumerable
Public Interface IPivotFields
    Inherits IEnumerable(Of IPivotField), IEnumerable
Examples
worksheet.Range["A1:C4"].Value = new object[,] {
    {"Product", "Region", "Amount"},
    {"Apple", "East", 100},
    {"Pear", "West", 200},
    {"Apple", "West", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
IPivotFields pivotFields = pivotTable.PivotFields;
IPivotField amountField = pivotFields["Amount"];

Properties

Name Description
Count

Gets the number of pivot fields in this collection.

This property returns the total number of IPivotField objects available in the PivotTable field collection.

this[int]

Gets the pivot field at the specified index.

Use this property to retrieve a single IPivotField from the IPivotFields collection by position.

this[string]

Gets the IPivotField with the specified name from this collection.

Use this property to retrieve a PivotTable field by its display name in the current IPivotFields collection.