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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supress an empty crosstab? 1

Status
Not open for further replies.

Snakeroot

Technical User
Oct 4, 2006
112
US
I have a summary page that looks like this:

Code:
     Main headings           5 
        Type 1         2
        Type 3         3

     Secondary headings      7
        Type 1         5
        Type 3         2

     Other headings          1
        Type 0         1

"Main headings", "Secondary headings" and "Other headings" are all text fields. The breakout of the types are done using cross tabs.

So using the layout above, there's a text field with the text "Main headings" with a crosstab under it, which is displaying Type 1 with a quantity of 2 and Type 3 with a quantity of 3. Same idea for Secondary Headings and Other Headings.

The main headings has a total number of the types of headings. IE, type 1 heading, of which there are 2, plus type 3 heading, of which there are 3, equals 5 Main Headings.

There will always be Main headings and Secondary headings, but only occasionally will there be Other headings.

This summary is sitting inside of a box, which grows. Right now, when there are no "Other headings" , the crosstab is still there, even though it can't be seen (no borders visible). It takes up space and doesn't let my surrounding box shrink to a smaller size.

How can I supress the crosstab when there are no values in it?
 
Depends on your Crystal version, which you need to give when asking a question.

FOr Crystal 9 and above, there is an option to suppress blank subreports, put it in its own section and check the 'Section Expert' to suppress a blank section.

In Crystal 8.5, the subreport is evaluated after the rest of the section, and after the decision that the section should be printed or suppressed.

For Crystal 8.5, you have to use a work-round:
a) Copy the subreport
b) Place the subreport in some higher section, and make it as small as possible.
c) Use Shared Variables to pass back a value, that will indicate whether or not the subreport should be suppressed.
d) Use this returned value to determine whether or not to suppress the main copy of the subreport.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Sorry Madawc. I'm using XI and I see what you're saying. Seems so simple now :) I didn't think about putting it in it's own section, but that makes sense. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top