I have a report with a column TaxBase printed by a method TaxBase().
At the end of my report section I need to display the Sum of TaxBase column.
I don’t know how!
Maybe the property SumAll can help? But, how is it used?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Setting the
SumAllproperty will help calculate report totals provided you use footer sections.Your footer section has to have a sum control (of class ReportSumControl) and reference the summed field in the
DataFieldNameproperty.This can done implicitly using an auto design. Take the report
TaxDeviationas an example. It has the fieldsTaxAmountandTaxBaseAmountwith theSumAllproperty set. The footer sections are generated at runtime for the grand total footer section and for each sort field with anAutoSumproperty set toYes.You can see this clearly if you generate the design by choosing “Generate design” on the
ReportDesign1node.You can by code reference the generated sums by using
element.sumControlorelement.sum. This can for example be used to calculate contribution ratios (using both methods):This method calculates the contribution ratio for a sales line sum of
LineAmountandCostAmount.