Place ReportSummary at the bottom in Run Time
Ok, I have a ReportSummary that needs to be at the bottom at the last page. I know if I use OnBeforePrint in the designer I can do it like this:
The problem is that I don't use the designer. Everything in my report is created in run time like this:
I tried this:
But this did not help. Any idea how I can move Reoirt Summary in run time?
procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);
begin
Engine.CurY := Engine.CurY + Engine.FreeSpace - ReportSummary1.Height - 1;
end;
The problem is that I don't use the designer. Everything in my report is created in run time like this:
frxReport:= TfrxReport.Create(Owner);
....
Page:= TfrxReportPage.Create(frxReport);
Page.CreateUniqueName;
Page.SetDefaults;
Page.Orientation:= poLandscape;
....
ReportSummary:= TfrxReportSummary.Create(Page);
ReportSummary.CreateUniqueName;
ReportSummary.Top:= 0;
ReportSummary.Height:= 50;
I tried this:
frxreport.ScriptText.Add('procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);');
frxreport.ScriptText.Add('Begin');
frxreport.ScriptText.Add('Engine.CurY := Engine.CurY + Engine.FreeSpace - ReportSummary1.Height - 1;');
frxreport.ScriptText.Add('end;');
But this did not help. Any idea how I can move Reoirt Summary in run time?
Comments
2. Add
ReportSummary.OnBeforePrint := 'ReportSummary1OnBeforePrint';
to your Delphi's code
Can you help me with point 1? How can I add my script at the begin of frxreport.ScriptText? I am not writing anything else in frxreport.ScriptText, isn't it at the beginning already?
Also set correct Top position for all bands
Anyway, thank you!
habe das gleiche Problem, das Summary-Band soll immer am Seitenende angezeigt werden, mit der Anweisung
Engine.CurY := Engine.CurY + Engine.FreeSpace - ReportSummary1.Height - 1;
wird der Report, je nach Zeilenanzahl, wie folgt angezeigt.
Attach your report template (fr3) and prepared report (fp3)
Did you don't show PageFooter on the last page too?
Use English
Hello,
Here the sample report.
Many Thanks
Georg Steinbrecher
Thanks for the good support ....