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

Page Caching

edited June 2002 in General
I use caching for all of my reports as is provides faster access to pages
once the report is generated.

When the report runs however, it will calculate the data for page 1 and then
stops until the user either hits next or last page. Is it possible to have
the report writer preview calculate page 1, display it and then continue
calculating the other pages so they are ready when the user needs them?

Thanks

Tony

--
Tony Wood
Turnkey Computer Technology Ltd.,
Thornton Lodge, East Kilbride Road,
Clarkston, Glasgow, G76 9HW
+44 (0) 141 644 5444 (Tel)
+44 (0) 141 644 5446 (Fax)


Comments

  • edited June 2002
    Set the Report.PassSetting to psTwoPass or you can also generate to a
    generic device to cache the pages:


    var
    lDevice: TppDevice;
    liIndex: Integer;
    begin

    lDevice := TppDevice.Create(Self);
    lDevice.PageSetting := psLastPage;
    lDevice.Publisher := ppReport1.Publisher;

    ppReport1.PrintToDevices;


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited June 2002
    Setting the passsetting to 2 pass does force it to continue calculating but
    unfortunately every press of the next/previous page button forces the report
    to regenerate that page even though the cache option is ticked and hence
    this negates the reason for using caching in the first place.

    Is it possible to run the report, have it generate page 1 and then call the
    go to last page function so that the rest of the report is generated while
    the user is viewing page 1. This seems to be a fundamental requirement as
    this is how other report writers work.

    Any ideas?

    Tony


  • edited June 2002
    For a OnePass report, try this:


    uses
    ppTypes, ppViewr, ppDevice;

    procedure TForm1.Button1Click(Sender: TObject);
    var
    lDevice: TppDevice;
    begin
    lDevice := TppDevice.Create(Self);
    lDevice.PageSetting := psAll;
    lDevice.Publisher := ppReport1.Publisher;
    ppReport1.CachePages := True;
    ppReport1.PrintToDevices;
    ppReport1.Print;

    end;

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.