Sub-report suppression when blank 
Author Message
 Sub-report suppression when blank

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



Wed, 25 Sep 2002 03:00:00 GMT  
 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



Fri, 04 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Subreport does not show when main report is blank

2. How to hide a blank Subreport in a Main Report

3. Blank page generated with Sub Reports

4. Blank Sub Reports not to print

5. Printing Blank Pages in VB 6.0 App - Report has 9 linked subreports

6. Sub Report with a Sub Report?

7. Sub Reports within Sub Reports

8. vb5 Crystal Reports 6 and Subreports Can we conditionally call subreports from primary reports

9. Sub Report in a Sub Report

10. Crystal Reports and VB.NET (Suppression?)

11. Data report and repeating field suppression..

12. SendObject sends Blank Report when report contains sub-reports.

 

 
Powered by phpBB® Forum Software