[]
Gets the collection of fields that are currently displayed as page fields in the PivotTable.
The returned collection is read-only and contains the fields whose orientation is set to the page area of the PivotTable report.
IPivotFields PageFields { get; }
ReadOnly Property PageFields As IPivotFields
worksheet.Range["A1:C5"].Value = new object[,] {
{"Region", "Product", "Amount"},
{"East", "Apple", 100},
{"East", "Pear", 80},
{"West", "Apple", 90},
{"West", "Pear", 70}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
pivotTable.PivotFields["Region"].Orientation = PivotFieldOrientation.PageField;
IPivotFields pageFields = pivotTable.PageFields;