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

Page limits

edited October 2003 in General
I have a rather large report (2500+ pages). I understand that
PageLimit will limit the number of pages for the report.

The report has the following values:

PassSetting = psTwoPass

I use the following code:

if (Sender as TRzBitBtn).Name = 'btnPrint' then
begin
ppReport1.PageLimit := 0;
ppReport1.DeviceType := dtPrinter;
end
else
begin
ppReport1.PageLimit := 100;
ppReport1.DeviceType := dtScreen;
end;
ppReport1.Print;

This seems to work well. Now the problem: my previewer has a print
button on it that executes:

ppViewer1.Print;

and the engine prints exactly 100 pages which is WAD. What I need
though is to print all pages (or whatever pages the user selects in
the print dialog) from within the previewer.

Is there any way to change the pagelimit of the report just before
calling ppViewer1.Print and not have the previewer try to
show(preview) all 2500+ pages?

- Bill

Comments

  • edited October 2003
    Hi Bill,

    You can get access to the Report object from the viewer by type casting the
    TppViewer.Report object as a TppReport. Something like the following:

    (TppReport(ppViewer1.Report).PageLimit := 100;

    If you place this line of code before your call to ppViewer1.Print; , you
    should get the results you are after.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2003
    I thought the same thing and had already tried that before writing.
    What happened was that it would print more than 100 pages but it would
    repeat the last page or two (can't remember exactly which pages) over
    and over again. I even tried to regenerate the report to see if that
    would help and it didn't change a thing.

    I also trired to replace the code ppViewer1.Print; with this:

    ppReport1.PageLimit := 0;
    ppReport1.DeviceType := dtPrinter;
    ppReport1.Print;

    in an attempt to recreate the report and send it directly to the
    printer. I got the same exact results.

    Can I suggest that you all add another PageLimit attribute and call it
    something like PreviewPageLimit that when set, limits only what is
    previewed and does not affect the printed limits. Let PageLimit limit
    the number of pages sent to all other devices.

    I still need to find a way to accomplish this. Any other suggestions
    or ideas?

    Thanks,
    - Bill


    On Thu, 9 Oct 2003 08:30:48 -0600, "Nico Cizik \(Digital Metaphors\)"
  • edited October 2003
    Any other ideas?


    On Thu, 09 Oct 2003 12:36:52 -0500, Bill Mullen
  • edited October 2003
    Hi Bill,

    In my testing I was able to get the PageLimit property to work correctly
    from the TppViewer. It also printed the correct pages. Below is a link to
    the test program I created. Let me know if I'm completely on the wrong
    track.

    http://www.digital-metaphors.com/tips/PageLimitFromViewer.zip

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2003
    Nico: Thanks. I will look at the code this evening.

    - Bill

    On Mon, 13 Oct 2003 11:23:23 -0600, "Nico Cizik \(Digital Metaphors\)"
  • edited October 2003
    Nico:

    Thanks for the help. I must have done something really wrong when I
    tried it out. I re-tried the code you provided and it worked fine. I
    wanted to remove the page limits so I set the value to 0 (zero) and it
    worked fine. I sure thought that I had tried this exact code before
    and it didn't work. Oh well, it works now - which is what matters!

    Thanks again.

    - Bill


    On Mon, 13 Oct 2003 11:23:23 -0600, "Nico Cizik \(Digital Metaphors\)"
This discussion has been closed.