INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • 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!

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

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Crystal XI - hide group header if no detail rows

Crystal XI - hide group header if no detail rows

(OP)
I have attached a report I've been trying to modify so that groups do not display if they have no detail records. I'm able to suppress the Details section and the Group Footer, but can't seem to get the Group Header to suppress.
I've tried various options but cannot get this to work. Any help appreciated!

FYI - The report connects to a SQL Server database, and is part of an application and so I can't change the report to be using a query instead of the tables it currently does.
Also restricted from using a sub-report.

RE: Crystal XI - hide group header if no detail rows

Assuming you have a later version of Crystal use Group Suppression
In Select expert select group
then add a formula like
Count({relevantfield}, {Groupfield}) = 0

This should suppress whole group - header, detail and footer

Ian

RE: Crystal XI - hide group header if no detail rows

(OP)
Thanks Ian. If you have a look at the attached file, I have tried that (comments in the Select Expert show all the various attempts).
I've tried this with WhilePrinting too to no avail. That works in the detail section and the group footer but not the header for some reason.

RE: Crystal XI - hide group header if no detail rows

Sorry can't down load file.
You will need to show what you have done/comments another way.

Ian

RE: Crystal XI - hide group header if no detail rows

Are there rows in the detail section that are suppressed or hidden based on group selection? (You mention suppressing the detail section.) If so, what formula are you using for suppression or group selection?

-LB

RE: Crystal XI - hide group header if no detail rows

Try and create a formula: sitecode_check

Add this to the formula:
if isnull(maximum({Call.CallDate},{Call.SiteCode})) then 'SUPPRESS' ELSE 'OK'

Then place this in the sitecode header.

If the formula produces: SUPPRESS
then you can easily suppress that header with this formula in the suppress rule:
PageNumber=1
or
{@sitecode_check} = 'SUPPRESS'

Just an idea.

RE: Crystal XI - hide group header if no detail rows

(OP)
Thank you for your help.
I tried to all these suggestions to no avail. I ended up modifying the report so that the totals were just in the group footer. Not what I was after, but too much time was being wasted.

RE: Crystal XI - hide group header if no detail rows

The problem is that you were trying to suppress a GH using the result of a Running Total. Running Totals are not evaluated until after the detail section, so are not available in the GH. The Formula you are summing is the result of a Variable which further complicates it.

Standard Crystal Summaries can be used in GH sections, so what you are attempting is only possible if you can use a standard Summary.

While you attempted to upload a copy of the report with saved data, one of the formulas does not complie so it is difficult to offer definitive, tested solutions. However I think this should work.

Change the formula {@DetailRowCnt} to:

CODE

IF      ISNull({Call.CallDate}) 
THEN    0
ELSE    1 

Then in the Group Selection Formula (Report => Selection Formulas => Group), enter this:

CODE

Sum({@DetailRowCnt},{Call.Extension}) <> 0 

Hope this helps. If not, save the report with data (ensuring all formulas compile) and post back again with the result of my suggestion.

Regards
Pete.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

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!

Resources

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