Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Show first Group Header but Suppress subsequent Post Reply Post New Topic
Author Message
tdavenport
Groupie
Groupie
Avatar

Joined: 21 Oct 2008
Location: United States
Online Status: Offline
Posts: 41
Quote tdavenport Replybullet Topic: Show first Group Header but Suppress subsequent
    Posted: 04 May 2010 at 2:53am
I have a Call Detail report that contains tech names in a Group.
 
The layout is:
 
Group 1 on CallID - This is a primary key.
 
Group 2 Field lables for Group 2b
 
Group 2b on Tech (and add. details) - There can be multiple techs per CallID.
 
Details is suppressed.
 
Group 1 footer contains subreport
 
I want to do the following:
 
Suppress Group 2 (Field lables) after the first instance of the Group is printed.
 
The issue I have now is that my field labels repeat for every technician. I would like for it to show only once.
 
Note: I have used conditional suppression - I'm just looking for the proper function. I have used PageNumber = '1' to suppress the first page header. So I'm thinking there might be an equivalent for the "first" group header.
 
Thank you!
 
Lockwell - You've helped me a lot in the past. I call on your POWERS!
 


Edited by tdavenport - 04 May 2010 at 2:54am
Any and all suggestions are welcome.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 04 May 2010 at 3:01am
create a formula with shared variable. In Group1, set it to 0, in group 2b, set it to 1.  In the conditional suppress for Group2, suppress it if it = 1.
 
G1-
shared booleanvar show:=true;
""
 
G2-suppress
shared booleanvar show;
not show
 
G2b
shared booleanvar show:=false;
""//just to hide the variable assignment
 
this should allow multiple callID's per report and only display gp2 1 time per callID.
 
HTH
 
IP IP Logged
tdavenport
Groupie
Groupie
Avatar

Joined: 21 Oct 2008
Location: United States
Online Status: Offline
Posts: 41
Quote tdavenport Replybullet Posted: 04 May 2010 at 5:27am
StarStarStarStarStar
 

OK, I'm trying to get my mind around this.

 

I've never created a shared variable before so this is what I did.

 

1. Created a formula that stated the following:

shared booleanvar show

     - I named this formula "Show"

 

2. Created a second formula that stated the following:

shared booleanvar show:=True;

""    

- I named this formula "Show G1"

 

3. Created a third formula that stated the following:

shared booleanvar show;
not show

    -I named this formula "Show G2"

 

4. Created a fourth formula that stated the following:

shared booleanvar show:=False;
""

 

I placed Show G1 inside of Group 1

I placed Show G2 inside of Group 2

I placed Show G2b inside of Group 2b

 

My suppress-if statement for Group 2 was:  {@Show G2}= True

 

AND IT WORKED!

 

I do not, however, understand what happened or why. I am just an apprentice.

 

The suppression did not work unless ALL of the formulas were in their appropriate group.

 

If you have time - and it's OK if you don't - Please explain what’s happening.

 

Also, I don't think I needed the first formula "Show". I think by simply declaring the booleanvar of "Show" - then it is known whenever it's stated again in any other formula.

 

Again - Thank you for your help. This solution solves a bunch of formatting challenges that I've had in the past – and eliminates future ones.

 

Your powers are great indeed.

Any and all suggestions are welcome.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 04 May 2010 at 5:35am
show g1, is setting a flag to true and show g2b is setting it false...CR reads from the top of the report to the bottom, to g1 is executed before g2b...each new callID turns the flag on, and the first tech (and all other techs) turn it off.
 
The big trick is the suppress formula. I would have done it differently, but what you did makes sense, so here goes.  Suppress formulas, suppress when at the end of the formula they see 'true' (do you want to hide this object = true...it's kind of backwards but you get used to it).  Show G2 is only true when the flag show is false, and Show G2b sets the flag to false, but only after the G2 section has printed.
 
So G1 set the flag, g2 prints, g2b sets the flag false g2 is suppressed is the basic order of events.
 
HTH
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.