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

Disable OnDrawCommandClick while report is generating/calculating

The title pretty much sums it up. Lately we are moving the bulk of our project under a single TFDConnection object.

We have OnDrawCommand click events that fire off some queries and it's stepping on the Report generation (UseBackgroundThread=True). Is there a boolean or some other way we can disable OnDrawCommandClicks until the report is completely done? Obviously we'd like to keep the multi threaded aspect of it if possible.

Comments

  • Hi Dusten,

    Use the TppViewer.OnEndGenerate event to determine when the page cache has finished. From there, you can re-attach the DrawCommandClick events. Access the viewer using the Report.PreviewForm property.

    uses
    ppViewr;

    procedure TForm2.ppReport1PreviewFormCreate(Sender: TObject);
    begin
    TppViewer(ppReport1.PreviewForm.Viewer).OnEndGenerate := ehViewer_EndGenerate;

    end;
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
Sign In or Register to comment.