How to hide label in main report if a subreport further down is empty?

Hello,

I am currently implementing a report which needs to look something like this (in a PDF format, not that it matters):
STATIC TEXT "SECTION 1 TITLE"
[Subreport 1 (using DataSet1)]
[Subreport 2 (using DataSet2)]
[Subreport 3 (using DataSet3)]
STATIC TEXT "SECTION 2 TITLE"
[Subreport 4 (using DataSet4)]
[Subreport 5 (using DataSet5)]
[Subreport 6 (using DataSet6)]

The "SECTION 1 TITLE" label needs to be seen in the page header of all the pages of subreports 1/2/3. It's a repeated header for the whole section. There are no page breaks between subreports 1, 2 and 3.

Here's where my requirement gets tricky: dataSets 1, 2 and 3 could all be empty so their subreports will be hidden. In that case, Section 1 would be completely empty so I should not show the title "SECTION 1 TITLE" and the section 2 title would be the first one visible.
This is what I am struggling to achieve. How do I hide the "SECTION 1 TITLE" label when all of the first 3 datasets are empty?
Is there a way to retroactively hide the section 1 title, after the subreports have been evaluated?

Thank you,
Didier

spambal2's picture
Joined: Feb 20 2023 - 12:31am
Last seen: 7 hours 32 min ago

1 Answer:

You can move the title to each subreport and then suppress it if the title has already been printed.

To identify if it has already been printed for each subreport pass a flag (vTitleHasPrinted) back to the main report.  Then pass that flag to each subsequent subreport.

jgust's picture
4926
Joined: Jun 10 2010 - 6:39am
Last seen: 4 days 21 hours ago
Feedback
randomness