Totals in Group Header: need explaining
So a while back I came across this video explaining how to add group totals to group header.
At one point the uploader puts 2 OnbeforePrint events.
In the second event he writes the line
Set(<ADOQuery1."Company">, Sum(<ADOQuery1."ItemsTotal">, MasterData1));
The field <ADOQuery1."Company"> has the company name. Why are we suddenly giving it a new value? Or am I misunderstanding the above line?
In the first event he writes
Memo3.Text:='Sum:'+FloatToStr(Get(<ADOQuery1."Company">));
If Memo2 already contains the sum, why not just write Memo3.Text:=Memo2.Text?
Comments
See here for more info: https://www.fast-report.com/publicdownload/docs/FRVCL/online/en/FastReportVCL/UserManual/en-US/Script/Printingthe_group%27s_sum_total_in_the_groups_header.html
The field <ADOQuery1."Company"> has the company name. Why are we suddenly giving it a new value? Or am I misunderstanding the above line?
<ADOQuery1."Company"> was used as unique value for name of report variaable.