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

Crystal XI - hide group header if no detail rows

Status
Not open for further replies.

TSASoft

IS-IT--Management
Apr 18, 2017
3
AU
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.
 
 http://files.engineering.com/getfile.aspx?folder=015d9141-817a-4430-bd72-544daeff9965&file=InBExtC.zip
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
 
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.
 
Sorry can't down load file.
You will need to show what you have done/comments another way.

Ian
 
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
 
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.
 
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.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top