Recent

Author Topic: [SOLVED] Repeat group footer's data and sums on the page footer  (Read 1861 times)

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 256
[SOLVED] Repeat group footer's data and sums on the page footer
« on: December 10, 2020, 11:02:19 am »
Hi,
I have a report that uses group header, master data, group footer and a page footer.
The page footer contains small picture with data sections that i need to fill with some text and summary contained on the group footer.
That is what I want to get, but the page footer shows data from the next group, Naturaly, because the group footer shows the group that ended.
 
How can i repeat the data from the group footer into the page footer?
« Last Edit: December 10, 2020, 01:00:01 pm by mirce.vladimirov »

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 256
Re: [SOLVED] Repeat group footer's data and sums on the page footer
« Reply #1 on: December 10, 2020, 01:07:28 pm »
Just solved it, few minutes back.

Thank god for having Lazarus and Lazreport developers which provided two great things in Lazreport :
1. Events
2. Setting frvariables during showreport

here it is:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.frReport1BeginBand(Band: TfrBand);
  2. begin
  3.   if band.Name='MasterData1' then begin
  4.     frVariables['Myvar1']:=thequery.FieldByName('myvar1').AsString;
  5.     frVariables['Myvar2']:=thequery.FieldByName('myvar2').AsString;
  6.   end;
  7. end;  

In the PageFooter band i use these variables named Myvar1 and Myvar2.
In this test example I used masterdata band, but it works with all bands types.

 

TinyPortal © 2005-2018