Totals in Group Header: need explaining

edited March 18 in FastReport VCL

Posting this also under Fastreport VCL in case the group Fastreport 4.0 was the wrong group:

So a while back I came across this video explaining how to add group totals to group header.

https://www.youtube.com/watch?v=TwmtT4rrvPM

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?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.