
Sub-report suppression when blank
The problem is that the subreport is already printed before the main report receives
the result. Seagate says (and I tend to believe them on this) that you need to insert
the same subreport into a section above the current one, then do your variable
evaluation in the section containing the subreport you want to show. Use the
sizing handle to make the upper subreport a minimum size, and drag the section
also to minimum size, but do not suppress the section.
Check the Seagate knowledge base for this (keyword subreport suppress). It's a
pain since it requires running the subreport twice. Depending on the information
returned by the subreport, you can use a simpler subreport as your show/hide
evaluation trigger.
Quote:
>I've used since release 4.5 and I've now upgraded to 8. I must say that
>8 is the best release ever. I first used CR with Paradox and I'm now
>using it with Delphi 5. I know this is a VB newsgroup, but my question
>and problem are VB-related within Crystal.
>I'm having a quirky problem with suppression of sub-reports when they're
>blank. I've got about 8 sub-reports in a main report. Whenever a sub-
>report is empty, I would like it to be suppressed. This works some of
>the time (mysteriously). Using VB syntax (or alternatively Crystal
>syntax) since version 8 is capable of both, I coded the following in the
>details section of my sub-report on the Suppress (No-drill down) formula
>button:
>Shared blInstRelSvc as Boolean
>if isNull({LiInstructionRelSvcs.ActivityCode}) then 'if field in table
> formula = True 'is blank then true
> blInstRelSvc = True
>else
> formula = False
> blInstRelSvc = False
>end If
>Then in the Format Section dialog box for the detail section where the
>sub-report is in the main form I coded the following on the Suppress (No-
>drill down) button:
>Shared blInstRelSvc as Boolean
>if blInstRelSvc then
> formula = True
>else
> formula = False
>end If
>In essence, if the blInstRelSvc variable is returned as True in the
>details section of the sub-report, then the detail section should receive
>the variable as True, and make suppression happen. It doesn't! and it's
>making me nuts!
>Do you have any suggestions?
>Thanks
>Peter