Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Standby Form

edited March 2002 in General
Does anybody know how to show a standby form while a report is processing?

I usually have a Print Button, and after it is clicked the first time, the
system pauses for about 3 or 4 seconds before the preview window is shown.
It would be nice either to have a blank form immediately show up, or to have
a form shown that simply says, "Standby..." or "Report generation in
progress." Any suggestions?

David Miller

Comments

  • edited March 2002
    It is kinda tricky, because you want to show a modal form/dialog so that
    execution will continue in the report generation process. You could use an
    autocreated form in your project. Before you call Report.Print, you can set
    the visibliity of the form to true, and set it to false once the page is
    received by the screen device:

    procedure TForm1.Button1Click(Sender: TObject);
    begin

    Form2.Visible := True;

    ppReport1.Print;

    end;

    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    var
    lScreenDevice: TppScreenDevice;
    begin
    lScreenDevice := TppViewer(ppReport1.PreviewForm.Viewer).ScreenDevice;
    lScreenDevice.OnPageReceive := OnScreenDevicePageReceive;
    end;

    procedure TForm1.OnScreenDevicePageReceive(Sender: TObject; aPage: TObject);
    begin
    Form2.Visible := False;
    end;

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.