[]
Gets or sets the position of the PivotTable field subtotals in relation to the specified field.
Use this property to determine whether subtotals for the field are displayed above or below the field items.
SubtotalLocationType LayoutSubtotalLocation { get; set; }
Property LayoutSubtotalLocation As SubtotalLocationType
worksheet.Range["A1:B4"].Value = new object[,] {
{"Category", "Amount"},
{"Beverages", 100},
{"Beverages", 200},
{"Snacks", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotField field = pivotTable.PivotFields["Category"];
field.Orientation = PivotFieldOrientation.RowField;
field.LayoutSubtotalLocation = SubtotalLocationType.Bottom;
SubtotalLocationType location = field.LayoutSubtotalLocation;