This actually refers to the Syncfusion Excel Pivot table.
I was trying to set this option Subtotals > Show all Subtotals at Top of Group in the Pivot table, but did not find a way to do so. Neither on Pivottable object but also not on the PivotField object. Perhaps I overlook it but could not find a reference in the documentation. Does someone know how this option could be set in code? At least on this level I could not find it:
pivotTable.Fields[11].Axis = PivotAxisTypes.Row;
pivotTable.Fields[11].Position = 0;
pivotTable.Fields[11].ShowBlankRow = false;
pivotTable.Fields[11].Subtotals = PivotSubtotalTypes.None;
pivotTable.Fields[11].PivotFilters.Add();
As a workaround for now I create a macro on opening the workbook that sets these options, but that will produce an xlsm file which is often restricted to open by the user. The macro code looks like the following and does work:
ActiveSheet.PivotTables(""PVTTableAuditProjectStaat"").PivotFields(""Contractor""). _
Subtotals = Array(True, False, False, False, False, False, False, False, False, False, _
False, False)
// And that for all fields...
ActiveSheet.PivotTables(""PVTTableAuditProjectStaat"").SubtotalLocation xlAtTop
Thanks for any input!