Subreport in details section of main report.
I have a subreport in the details section of the main report, the sub report calculate the total weight for each detail line on a delivery note. At the bottom of the total weight coloum I want the grand total for all the items on the delivery note. When I insert the the grand total or subTotal option on the subreport, it gives me the grand total for each detail line and not for all the lines together.
What am I doing wrong?
Plz help.
Re: Subreport in details section of main report.
The only way to total values generated by a subreport is to use a "Shared Variable".
SetGrandTotal - Formula in sub report
WhilePrintingRecords;
Shared numberVar GrandTotal;
GrandTotal := GrandTotal + {Table.Field};
DisplayGrandTotal - formula in Main Report
WhilePrintingRecords;
Shared numberVar GrandTotal;
GrandTotal;
You will also need a Formula that initializes the shared variable. Place it in the
Report Header section or a Group Header section to reset it back to 0 for each group.
WhilePrintingRecords;
Shared numberVar GrandTotal:=0;
Re: Subreport in details section of main report.
Hai brucevde,
After 2 years post helped me today.
Thanks
:wave::wave::wave::wave::wave::wave: