Hi,
I am using Aspose.cells for creating a pivot table. Is there a way to turn off grand total and subtotals for a pivot table. I can achieve the behavior using excel but I cannot find a code for it in aspose
You may please give a try to the following sample code and provide your feedback. If it does not fulfill your requirement, provide us a runnable console application, a source template file, program output file and an expected output file created by Excel. Also explain the requirement using some images for clarification. We will analyze the information and provide our feedback.
Workbook book = new Workbook("Example.xlsx");
PivotTable table = book.Worksheets["Pivot Table"].PivotTables[0];
table.RowGrand = false; //Set true if you wish to show the grand row total
table.ColumnGrand = false; //Set true if you wish to show the grand column total
for (int i = 0; i < table.RowFields.Count; i++)
{
table.RowFields[i].SetSubtotals(PivotFieldSubtotalType.None, true);
}
book.Save("output.xlsx");
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.