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

Pre-cache entire report?

edited September 2002 in General
I have a report that does a lot of calculations.

I'd like to cache the entire report before the preview window is
displayed. Sort of run it from beginning to end without the user seeing
it and caching turned on, and only then bring up the preview window.

Comments

  • edited September 2002
    You can always create a 'dummy' device on the fly, run the report into
    cache, then print it again:

    uses
    ppDevice;

    var
    lDevice: TppDevice;
    begin

    ppReport1.DeviceType := dtScreen;

    lDevice := TppDevice.Create;
    lDevice.Publisher := ppReport1.Publisher;
    lDevice.PageRequest.PageSetting := psAll;

    ppReport1.CachePages := True;
    ppReport1.PrintToDevices;

    lDevice.Free;

    ppReport1.Print;

    end;

    --
    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
  • edited September 2002
    FYI, you need to also use ppTypes, and change the create line to:

    lDevice := TppDevice.Create(self)

    but it does work. Thanks.



  • edited September 2002
    Of course, got a little too "on-the-fly" on that one. Great work figuring
    it out...

    --
    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
This discussion has been closed.