[]
Changes the subtotal location for all existing pivot fields.
Changing the subtotal location has an immediate visual effect only for fields in outline form, but the setting is also applied to fields in tabular form.
If the row axis layout is TabularRow, the
location must be Bottom.
void SubtotalLocation(SubtotalLocationType location)
Sub SubtotalLocation(location As SubtotalLocationType)
| Type | Name | Description |
|---|---|---|
| SubtotalLocationType | location | The subtotal location to apply to all existing pivot fields. |
worksheet.Range["A1:B4"].Value = new object[,] {
{"Category", "Amount"},
{"Beverages", 100},
{"Snacks", 200},
{"Beverages", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"]);
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
pivotTable.SubtotalLocation(SubtotalLocationType.Bottom);
| Type | Condition |
|---|---|
| ArgumentException | If the row axis layout is TabularRow and |