[]
Gets or sets the order in which page fields are added to the PivotTable report layout.
The returned value is one of the Order constants: DownThenOver or OverThenDown. The default value is DownThenOver.
Order PageFieldOrder { get; set; }
Property PageFieldOrder As Order
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;
pivotTable.PageFieldOrder = Order.OverThenDown;
Order order = pivotTable.PageFieldOrder;