[]
Specifies where subtotals are displayed in a PivotTable report.
Use Top to place subtotals above the related field items, or Bottom to place them below the related field items. When used with SubtotalLocation(SubtotalLocationType), Bottom is required if the PivotTable row layout is TabularRow.
public enum SubtotalLocationType
Public Enum SubtotalLocationType
worksheet.Range["A1:B5"].Value = new object[,] {
{"Product", "Amount"},
{"A", 100},
{"A", 200},
{"B", 300},
{"B", 400}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "PivotTable1");
pivotTable.PivotFields["Product"].Orientation = PivotFieldOrientation.RowField;
pivotTable.SubtotalLocation(SubtotalLocationType.Top);
| Name | Description |
|---|---|
| Bottom | Specifies that subtotals are displayed below the related PivotTable field items. |
| Top | Specifies that subtotals are displayed above the associated detail rows. |