Print Page | Close Window

Suppress GroupHeader when Details were suppressed

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19375
Printed Date: 02 May 2024 at 10:47am


Topic: Suppress GroupHeader when Details were suppressed
Posted By: PStefano
Subject: Suppress GroupHeader when Details were suppressed
Date Posted: 08 Apr 2013 at 6:07am

Hi to all, it’s a pleasure to write into this forum.

 

Referring to the above object, I looked for an answer into the web but without success. But I’m a newbie in this forum and maybe I did not get it. Well, below detailed the problem.

 

I have a report (made with CR XI, based on a sql View, linked to a SQL Server 2008 database) that is structured like:

GROUP HEADER 1

                GROUP HEADER 2

                               DETAIL1

                               DETAIL2

                               […]

                GROUP FOOTER 2

GROUP FOOTER 1

 

The report works fine but I can’t understand what I have to do to achieve those two goals:

1) I have to suppress Group header 2 when all its details are suppressed;

2) I have to suppress Group header 1 when all “its” group header 2 are suppressed.

 

This report shows to the user a customer list (detail) grouped by Macro Territorial Zone (group 2) and Financial Agent (group 1). Nearby each customer is placed its own account balance.

The report can be used by an external program which sends values to valorize some formulas inside the report. Through this way, users can choice if print or not customers with a “zero” account balance.

 

In the Detail’s Report Expert Section I put a control in the Suppress Formula that will suppress a detail if the account balance is zero, while user chose to suppress customer with a zero account balance.

 

But now, how can I get the first goal? And what about the second?

 

Thank you in advance for kind support!



Replies:
Posted By: lockwelle
Date Posted: 09 Apr 2013 at 2:45am
I would try in Section Expert for Group Header 2, Suppress when blank. 
HTH


Posted By: PStefano
Date Posted: 16 Apr 2013 at 10:16pm
Thanks for the reply lockwelle, but my group has never blank because it contains always details that are suppressed in accordance with a formula, and I have to suppress the group only if all its details have been suppressed.

The report works fine but I can’t understand what I have to do to achieve those two goals:

1) I have to suppress Group header 2 when all its details are suppressed;

2) I have to suppress Group header 1 when all “its” group header 2 are suppressed.




Posted By: DBlank
Date Posted: 17 Apr 2013 at 3:43am
create a formula field to use the same condition as your detail section suppression criteria for the detials but add in a "if-then" portion to make it return a 1 or a 0
 
if "suppression criteria here" then 0 else 1
 
now you can sum this at group level 2
sum(formula,groupfield2)
if the sum is > 0 then you have at least one row that is not suppressed so use that as your gh suppression formula
sum(formula,groupfield2)=0
 
Do the same thing for group level 1. If any detail has a value of 1 then your sum will not be 0 so use that as your suppression criteria in that GH section
sum(formula,groupfield1)=0



Print Page | Close Window