[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.LayoutSubtotalLocation

LayoutSubtotalLocation Property

LayoutSubtotalLocation

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.

Declaration
SubtotalLocationType LayoutSubtotalLocation { get; set; }
Property LayoutSubtotalLocation As SubtotalLocationType
Examples
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;