Sum a column in subreport and show in main report
Sum a column in subreport and show in main report
Hi,
I have a report with two sub reports. I need to get the sum of columns from each of the sub report to be shown in the main report.
Can you please let me know how this can be handled?
Thanks
I have a report with two sub reports. I need to get the sum of columns from each of the sub report to be shown in the main report.
Can you please let me know how this can be handled?
Thanks
Re: Sum a column in subreport and show in main report
Hello,
Please send us your report with test data for analysis.
Also please try to use the Totals.Sum() function.
Thank you.
Please send us your report with test data for analysis.
Also please try to use the Totals.Sum() function.
Thank you.
Re: Sum a column in subreport and show in main report
Hi,
PFA the report and the data for the report.
Currently I am getting the sub report column totals in the sub-report itself.
I would like to get these totals in a Footer in the main report so that both the totals come at the end of the report.
Thanks
PFA the report and the data for the report.
Currently I am getting the sub report column totals in the sub-report itself.
I would like to get these totals in a Footer in the main report so that both the totals come at the end of the report.
Thanks
- Attachments
-
- BSRep.mrt
- (89.68 KiB) Downloaded 194 times
-
- Data for Rep.xlsx
- (11.16 KiB) Downloaded 191 times
Re: Sum a column in subreport and show in main report
Hello,
In this case, as a way, you can use the additional variables and DoublePass. In first pass you can calculate necessary sum by column, sets value for variable and use these variables on main page.
Thank you.
In this case, as a way, you can use the additional variables and DoublePass. In first pass you can calculate necessary sum by column, sets value for variable and use these variables on main page.
Thank you.
Re: Sum a column in subreport and show in main report
Can you please give an example as to how to use Double pass?
Thanks
Thanks
Re: Sum a column in subreport and show in main report
Hello,
Please check the sample report in the attachment.
Thank you.
Please check the sample report in the attachment.
Thank you.
- Attachments
-
- ReportSample.mrt
- (18.84 KiB) Downloaded 336 times
Re: Sum a column in subreport and show in main report
Hi,
I checked the report, but didn't understand what the {SumSubReport} actually calculated. How is it taking any value from the sub-report?
If I use the same in my report, I get the following error :
"error CS0103: The name 'SumSubReport' does not exist in the current context"
Please let me know how to resolve the same.
Thanks
I checked the report, but didn't understand what the {SumSubReport} actually calculated. How is it taking any value from the sub-report?
If I use the same in my report, I get the following error :
"error CS0103: The name 'SumSubReport' does not exist in the current context"
Please let me know how to resolve the same.
Thanks
Re: Sum a column in subreport and show in main report
Hello,
Please check the BeforePrint event of DataBand on SubReport. In this event calculating the value for SumSubReport variable.
Thank you.
Please check the BeforePrint event of DataBand on SubReport. In this event calculating the value for SumSubReport variable.
Thank you.
Re: Sum a column in subreport and show in main report
Hi,
Thanks for the help. It worked.
But I didn't give the if(IsFirstpass) condition. Is that ok? Or will it cause a performance issue?
Please let me know.
Thanks.
Thanks for the help. It worked.
But I didn't give the if(IsFirstpass) condition. Is that ok? Or will it cause a performance issue?
Please let me know.
Thanks.
Re: Sum a column in subreport and show in main report
Hello,
It is for correct calculation of value. In the first pass we get the value and in second show it.
Thank you.
It is for correct calculation of value. In the first pass we get the value and in second show it.
Thank you.