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

Causing Subreports to print depending on pagenumber

edited November 2005 in General
Hi,

I have a situation where I want certain subreports to only print depending
on the current page number.

I tried adding this code to the ONPrint event, but it made the subreport
invisible to the whole report, if the total reports pagecount was greater
than 1.

ppSubReport1.Visible := PackInstDetR.PageNo < 2;

(I'm assuming that it was visible the first time round, but when the report
created the second page, and it retriggered, it made invisible the
subreport, even back on the 1st page).

What is the correct way to accomplish this please?

Thanks & Regards

Adam Hair.

Comments

  • edited December 2005
    Hi Adam,

    Try using the Band.BeforePrint event of the band that the subreport is in.
    Try placing a break poing on the line to be sure it is getting fired and
    that the visibility of the subreport is properly being changed for a given
    page.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2005
    Hi Nico,

    That seems to have fixed the problem. Thank you.

    Regards

    Adam.
This discussion has been closed.