Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Suppress GroupHeader when Details were suppressed Post Reply Post New Topic
Author Message
PStefano
Newbie
Newbie


Joined: 07 Apr 2013
Location: Italy
Online Status: Offline
Posts: 2
Quote PStefano Replybullet Topic: Suppress GroupHeader when Details were suppressed
    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!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 09 Apr 2013 at 2:45am
I would try in Section Expert for Group Header 2, Suppress when blank. 
HTH
IP IP Logged
PStefano
Newbie
Newbie


Joined: 07 Apr 2013
Location: Italy
Online Status: Offline
Posts: 2
Quote PStefano Replybullet 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.




Edited by PStefano - 16 Apr 2013 at 10:26pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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


Edited by DBlank - 17 Apr 2013 at 3:45am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.