Lazreport : How Print at the bottom of the last page lazarus / 31-LCL ---------------------------------------------------------------------- tintinux · 2011-04-20 08:26 Hi Is it possible to print a summary at the bottom of a report, only on the last page when there are several pages. This is usually what is expected in an invoice, for example. A ReportSummary is printed after the last detail line. A Page footer is printed on each page. I do not see any band type or option to print once at the report bottom. Thanks for your help. Tintinux ---------------------------------------------------------------------- zeljko · 2011-04-20 14:11 Quote from: tintinux on April 20, 2011, 10:26:33 amHi Is it possible to print a summary at the bottom of a report, only on the last page when there are several pages. This is usually what is expected in an invoice, for example. A ReportSummary is printed after the last detail line. A Page footer is printed on each page. I do not see any band type or option to print once at the report bottom. Thanks for your help. Tintinux You can use MasterDataFooter (or whatever name it is) for that ---------------------------------------------------------------------- tintinux · 2011-04-20 17:23 I have tried with a MasterFooter band, but it is printed right after the last MasterData, same as ReportSummary. I want to print in the bottom of the page, even when there is not many MasterData lines. Regards Tintinux ---------------------------------------------------------------------- denver · 2011-04-20 20:00 Basically, I will use the code only ( without the visual designer ) to create reports. so you can get full control of the report. Lazreport allow you to create report from code only. ---------------------------------------------------------------------- zeljko · 2011-04-21 07:04 Quote from: tintinux on April 20, 2011, 07:23:22 pmI have tried with a MasterFooter band, but it is printed right after the last MasterData, same as ReportSummary. I want to print in the bottom of the page, even when there is not many MasterData lines. Ah, ok, you can do that on PageFooter, since there's should be variable which says that it's last page, so then just make visible memos with your results.Basically (in OnBeforePrint or PageFooter) you can say if [PAGE] = [TOTALPAGES] then begin    Memo1WithResult.Visible := True;    Memo2WithResult.Visible := True; end; I'm not sure if names of variables are correct, look at LazReport source, also take a look if FINALPASS variable exists. I'm using FastReports and such vars exists there. Also if you use TOTALPAGES then you should enable "DoublePass" on your report (in designer). ---------------------------------------------------------------------- tintinux · 2011-04-21 11:36 Hi Thanks for the help, it is a little better now. But when the PageFooter is not printed, the data lines are not printed in the freed space, and a blank space remains on the bottom of the first pages. I have tried, without success, with OnBeginPage. Any idea to use the entire sheet of paper ? However, all this is a bit tricky, and make the report description more dependent on the code. I definitely don't want to generate the report by code, to allow users to change the layout with the designing tool. Better would be, IMHO,  an option in ReportSummary to print at the bottom, like we can find in many other report generators. If someone is interested the code I used is : Code: [Select]procedure TForm.ReportBeginBand(Band: TfrBand); var   CurrentPage, TotalPages : Variant ; begin   if (Band.Typ = btPageFooter) and Report.FinalPass then   begin     Report.GetVariableValue('PAGE#', CurrentPage );     Report.GetVariableValue('TOTALPAGES', TotalPages );     Band.Visible := (CurrentPage = TotalPages) ;   end; end; Regards, Tintinux