Posted 26 May 2020, 9:31 am EST
Hello,
On PivotGrid initialization, I was able to create GrandTotal and move it to the top:
this.ng = new wjOlap.PivotEngine({
itemsSource: this.data,
fields: this.constructValueAddFields(),
rowFields: ['ColumnHeader1', 'ColumnHeader2'],
valueFields: [],
showRowTotals: 'Subtotals',
totalsBeforeData: true
});
Issue is: I have a subtotal button. When its clicked I need to display subtotals.
Subtotals are displayed correctly, but this action wipes out GrandTotal.
Below is the code:
subTotalAndGrandTotal() {
this.pivotGrid.engine.showRowTotals = wjOlap.ShowTotals.None;
this.pivotGrid.engine.showRowTotals = this.level === 1 || this.level === 2 || this.level === 3 || this.level === 4 ? wjOlap.ShowTotals.Subtotals : wjOlap.ShowTotals.None;
this.pivotGrid.engine.totalsBeforeData = true;
this.pivotGrid.refresh();
}
May I know how can I prevent it from removing the GrandTotal?