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

Subreport

edited December 2003 in General
I have a report and depending on a field it sometimes need to print a second
page containing extra information. So I created a subreport for this in the
summary band of the first report.
I connected the subreport to another ppDBPipeline. I added some captions
and datafield to the subreport.

On the BeforePrint event of the HeaderBand of the main report I have this
code:

DM.QueryInvoiceView.Close;
DM.QueryInvoiceView.ParamByName('ID').AsInteger :=
DM.InvoiceViewIN_ID.AsInteger;
DM.QueryInvoiceView.Open;
ppSubReport1.Visible := DM.QueryInvoiceViewIN_OCMW.AsBoolean;

Now the problem is that the subreport doesn't seem to get printed. Why is
this? I looked in the techtips for subreports but couldn't find anything
that relates to this problem. I tried playing with PrintOnNewPage settings
but this doesn't seem to make any difference.

Any clues?

BTW Just to make sure I debugged and the
DM.QueryInvoiceViewIN_OCMW.AsBoolean is true of course :)

Thanks in advance,

Stijn Verrept. (using RB6.03)

Comments

  • edited December 2003
    Hi Stijn,

    If you disconnect the HeaderBand.BeforePrint event and set the subreport's
    Visible property to True, does the subreport print? Then once you connect
    the BeforPrint event back, be sure the line setting the visibility is
    actually firing and that you are not setting the visibility of the subreport
    back to False anywhere else in your app.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2003
    Thanks Nico, one step closer.

    I have moved the subreport to the footer of the group because the page needs
    to appear behind each group (if the criteria is met). Now I need to get the
    subreport to print on a new page but this doesn't want to work. I see the
    subreport alright at the bottom of the main report (not good) so I though I
    try NewPage property of the TitleBand of the ppSubReport but when I do this,
    the pages get created but they are blank (I do see the footer of the main
    report, which is ok, but the subreport isn't visible).

    Any clues?

  • edited December 2003
    Switched to section and now it seems to work :) Thanks again.
This discussion has been closed.