pivotTable.ColumnGrand = false;
Hi,
Thanks for your posting and using Aspose.Cells.
In order to investigate this issue, please download the attached source excel file and modify the pivot table via MS-Excel as per your expected pivot table. Then provide us your expected pivot table file. We will then look into it via Aspose.Cells code and provide you an equivalent code which you will then try in your original report code and it should fix the issue hopefully. Thanks for your cooperation in this regard and have a good day.
Thanks; I don’t know how to do it in Excel proper; I do it all in code. I am now just generating the Grand Total column manually, since there seems to be no easy way to override bits and pieces of the auto-generated column.
Hi,
I didn’t say it’s not possible to do it directly in Excel; I said I don’t know how to do it that way. Anyway, rather than allow the grand totals to be generated and then overwrite certain values, I ended up creating my own manually and then “tacking it on” to the right of the pivot table; the code for how I did that is here: http://stackoverflow.com/questions/40725696/how-can-i-replace-automatically-generated-grand-total-values-with-different-ones
Hi,
Hi,
var sheet = book.Worksheets[“PivotTableSheet”];
PivotTable pivot = sheet.PivotTables[0];
pivot.DataFields[1].DataDisplayFormat = PivotFieldDataDisplayFormat.PercentageOfColumn;
pivot.DataFields[2].Function = ConsolidationFunction.Average;
pivot.RefreshDataFlag = true;
pivot.RefreshData();
pivot.CalculateData();
pivot.RefreshDataFlag = false;
book.Save(filePath + “out.xlsx”);