[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.CurrentPage

CurrentPage Property

CurrentPage

Gets or sets the index of the current page item displayed for the page field.

This method is valid only for page fields. The returned index is zero-based. A value of -1 indicates that the page field is showing All or multiple items.

Declaration
int CurrentPage { get; set; }
Property CurrentPage As Integer
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Region", "Amount"},
    {"East", 100},
    {"West", 200},
    {"East", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotField pageField = pivotTable.PivotFields["Region"];
pageField.Orientation = PivotFieldOrientation.PageField;
int currentPage = pageField.CurrentPage;