Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

How to hide grand total for specific columns?

Answered
Subramanian asked on November 9, 2020

2 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 9, 2020

Hello,
 
Thank you for posting your question on our forum.
 
To hide grand totals for the specific columns, we suggest using the customizeCell API call provided by Flexmonster. This API call allows the customizing of separate cells.
 
You can choose cells to hide based on the information received from the second parameter passed to the handler. It is represented as a Cell Data Object and contains all information about the cell.
For example, to hide grand totals for “Quantity” and “Discount” measures, the following code snippet may be used:

let hiddenGrandTotal = ["Quantity", "Discount"];

flexmonster.customizeCell((cell, data) => {
  if (data.isGrandTotal && data.hierarchy && hiddenGrandTotal.includes(data.hierarchy.caption)) {
    cell.text = ""; //replace cell content with an empty string
  }
});

 
Add additional conditions for more specific filtering. For example, it is possible to hide grand totals based on columns and rows indexes, etc.
 
You are welcome to see the JSFiddle we have prepared to demonstrate this approach.
 
Please let us know if it works for your case.
Feel free to contact us in case additional questions arise.
 
Best regards,
Illia

Public
Subramanian November 9, 2020

Thanks for the quick solution. It works for me

Please login or Register to Submit Answer