Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress detail when subreport is blank

Status
Not open for further replies.

Ofina

Technical User
Feb 25, 2004
156
US
I have a subreport located in the detail section of my main report. I know how to suppress the subreport if it is blank. But, I want to go further. I want to suppress (or filter out) the given detail line if its subreport is blank.

I'm pretty sure I can have the subreport return a flag to the main report to use to filter out lines of detail, but is there an easier way? Can I do something like include in the Select Expert of the main report "subreport is not blank"?
 
That won't work. The section I'm looking to suppress is not based on its own content, but rather the content of the subreport on it. The detail that the subreport sits on is not blank, it has data.
 
you said "I want to suppress (or filter out) the given detail line if its subreport is blank."

if the subreport is blank, you can suppress the section it resides in using the 'Suppress Blank Section' option.
You would also likely need to right click on the subreport and set it to be suppressed if blank.

i guess i am not understanding your problem.

 
I think the key point that you're missing is that there is other data in the detail section other than just the subreport. It will never be blank itself. So, setting it to suppress blank section does nothing. I want to suppress the detail line (that contains info) if its subreport is blank.
 
I'm pretty sure this is doable by having the subreport return a flag for blank or not blank and then suppress based on that flag.
 
Add the subreport to a detail_a section and then format detail_a to underlay following sections. Then you can pass a shared variable from the sub to a suppression formula on detail_b. Add another suppressed section detail_c where you put a reset formula for the shared variable. Also add the reset to the main report header:

//{@reset} - report header and detail_c:
whileprintingrecords;
shared numbervar x := 0;

//{@subreport formula placed in sub report footer:
whileprintingrecords;
shared numbervar x;
x := maximum({table.ID});

//detail_b suppression formula:
whileprintingrecords;
shared numbervar x;
x = 0; //note no colon

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top