Dephi and Quickreport – How to get Page Number

Hi guys,

Recently I encountered a challenge in quickreport that has 2 specific criteria. The invoice report I was making needs to behave both as a page footer and a summary band.

Well the page footer needs to stay because there was a gap at the bottom to write the page number and signature boxes. The summary band comes in because the total amount of the invoices needs to be positioned at the bottom

How to solve it. I took the total number of pages and when the report reaches the last page, the system will display the total amount

  1. Quickreport needs to have a PageHeaderBand
  2. Inside the PageHeaderBank BeforePrint event handler you can ask for the QuickREport1.QRPrinter.PageNumber

Those were the 2 tips that I got from stockoverflow. Really big help for me.

Hope this article helps

Coffee Cup

Delphi Buttons – Create an hour glass impression while waiting

Got a chance to receive source code from a software vendor and the button on this program made me smile.

Haven’t though of it that way. But i think it works.

procedure TSFTPClientFrame.btConnectSSHClick(Sender: TObject);
var
  OldCursor: TCursor;
begin
  OldCursor := Screen.Cursor;
  try
    Screen.Cursor := crHourGlass;
    ScSSHClient.Connect;
  finally
    Screen.Cursor := OldCursor;
  end;
end;

The hour glass cursor is within the try row. Once it is done, it revert backs the cursor to the original one used. Pretty awesome.

Just wanted to share

Coffee Cup