We help IT Professionals succeed at work.

Suppressing Section with Sub-Report in Crystal Reports

clyde30152
clyde30152 asked
on
I have created a subreport which passes a variable to the main report.  The subreport is the only item in the detail A section.   If I suppress the detail A section, it causes the shared variable to become zero.   If I don't suppress it, even though I suppress everything in the subreport, it messes up my line spacing with a blank line.  I'm assuming I'm missing something simple.   Any help would be appreciated.
Comment
Watch Question

As you've seen, if you simply suppress the section, the subreport isn't run.

 What you can do is:

 Suppress everything in the subreport (which you've done).
 In the main report, go into the subreport format and check the "Suppress Blank Subreport" option on the Subreport tab.
 Check the "Suppress Blank Section" option for that section of the main report.

 Then CR should run the subreport (and set your variable), but the subreport doesn't produce any output, so it is suppressed, and then the section is blank, so it is suppressed.

 James

Author

Commented:
Thanks ... it didn't occur to me there were two places to check.
Yeah, it makes sense when you think about the process, but it's not exactly obvious.  :-)  You're welcome.

 James