Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I really enjoy your site. You have a lot of helpful and friendly experts who contribute so willingly. Thank you for past (and future) technical advice..."

Geography

Where in the world do Tek-Tips members come from?
Ofina (TechnicalUser)
25 Jul 12 11:56
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"?
fisheromacse (IS/IT--Management)
25 Jul 12 15:27
in the Section Expert is an option to 'Suppress Blank Section'
Ofina (TechnicalUser)
25 Jul 12 15:29
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.
fisheromacse (IS/IT--Management)
25 Jul 12 16:07
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.

Ofina (TechnicalUser)
25 Jul 12 16:13
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.
Ofina (TechnicalUser)
25 Jul 12 16:14
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.
lbass (TechnicalUser)
28 Jul 12 11:42
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

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close