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

autorefresh report

edited September 2014 in General
Hi!
i need to create a report can make a db refresh and auto repaint.

as you suggest, i use code from this example:
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/How_To...Refresh_the_Report_After_a_Drawcommand_Click

so i write this

"
ppReport1.Reset;
ppReport1.Engine.Reset;
[db refresh...]
TppDrawText(aDrawCommand).RedrawPage := True;
"

inside a DrawCommandClick of one of my label inside report.
so when i click on it, it correctly refresh.

i'm tring to use a ttimer to do the same autmatically every 5 mins.

i need a "TppDrawText" istance to force refresh, so inside ontimer
event i tried to call " pplabel.DrawCommandClickEvent(self) " to force
RB to execute onDrawCommandClick code, but it's not fired. I tried
with rb 14 and 15.

how can i call a method with a "TppDrawText" paramter from "outside"
report builder?

thanks

Comments

  • edited September 2014
    Hi Diego,

    Take a look at the TppViewer.PaintBoxClickEvent routine to see exactly
    what happens when a drawcommand is clicked with the RedrawPage property
    set to true. You will want to mimic this behavior in your own event.

    Something like the following...

    uses
    ppViewr;
    ...

    var
    lViewer: TppViewer;
    begin
    ...

    //Reset the report and report engine
    Report.Reset;
    Report.Engine.Reset;

    //Redraw to the screen
    lViewer := TppViewer(Report.PreviewForm.Viewer);
    lViewer.ScreenDevice.MakePageRequest;

    end;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.