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

Subreport not printing because of no data in another one?

edited June 2004 in Subreports
Hi,

I have a report with 2 datasources, a master and a detail.

The first subreport is linked to the master table. In it's detail band, it
has 2 other subreports. (Subreport2, and Subreport 3).

Subreport2 is linked to the detail table, while subreport is linked to no
tables.

I want subreport3 to print, REGARDLESS of whether or not their is any data
in subreport2. Because subreport 3 is linked to Subreport1's detailband, and
not to subreport2, I thought this would happen, but it does not. It ONLY
prints, when the detail table has a record in it.

HOWEVER - If I delete subreport2 altogether, then subreport3 prints without
any hesitations.

As this is confusing, I have placed a demo of what is happening at:
http://www.wsd.net.au/debug/debug.zip for you to download and see what I am
trying to do.

To reproduce the problem, simply run the application, and press Button1.

Then, delete Subreport2, and re-run the application. You will see that the
first time round, you don't get code "B" at all, but after you delete
subreport2, you do.

Can you please tell me what I have done wrong?

Thanks & Regards

Adam Hair.

Comments

  • edited June 2004

    For the detail DataPipeline set SkipWhenNoRecords to False.

    The following is from the online help topic for the SkipWhenNoRecords
    property:

    This property applies only to the detail DataPipeline of a master/detail
    relationship. It indicates that the report engine should skip to the next
    record of the master DataPipeline when no records are found in the detail
    DataPipeline. The default value is True

    Setting this property to false will force the DetailBand to print once for
    the empty dataset. All data-aware controls attached to the detail
    DataPipeline will return nulls in this case.


    --

    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2004
    Hi Nard,


    Thank you very much for your reply. This did the trick. I did not think of
    the effect that this property would have on a detailband with mutiple
    subreports.

    Thanks you very much for your help!

    Adam.
This discussion has been closed.