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

Subreport Still Printing When It Shouldn't

edited June 2004 in Subreports
I have a subreport that is nothing more than a container holding other
subreports in order to get the desired result when there is no data in these
sub-subreports. Here's how it looks:

Main Detail (data assigned)
-Subreport1 (no data)
+Line1
+Region1
*Subreport2 (data assigned)
*Subreport3 (data assigned)
+Region2
*Subreport4 (data assigned)
*Subreport5 (data assigned)

In the instances when subreports 2 - 5 don't return any data (and properly
don't print themselves) I am still getting Line1 in my printed report. How
can I prevent this?

TIA.

-Chris

Comments

  • edited June 2004
    I scoured the help file for ways to access some sort of NoData property for
    data pipelines and couldn't find anything so I started experimenting with
    other things and found this to work:

    SubReport1.Visible := True;

    if ((DataPipeline2.FieldObjects['IDField'].IsNull)

    and (DataPipeline3.FieldObjects['IDField'].IsNull)

    and (DataPipeline4.FieldObjects['IDField'].IsNull)

    and (DataPipeline5.FieldObjects['IDField'].IsNull)) then

    SubReport1.Visible := False;


    The IDField for each of the pipelines is a field that can't be null if there
    is a record (it is also the Master/Detail linking field).

    Is there a better way to do this, or am I going to be alright with what I've
    figured out here? It seems to be working fine...

  • edited June 2004

    That is probably as good a way as any.

    The other way that comes to mind would something like

    if (DataPipeline2.Bof and DataPipeline2.Eof) and....


    --

    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.