Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: header Post Reply Post New Topic
Author Message
rptxyz
Newbie
Newbie


Joined: 24 Nov 2007
Online Status: Offline
Posts: 27
Quote rptxyz Replybullet Topic: header
     Posted: 14 Apr 2008 at 9:43pm

Have a report with a formula in group header. a conditional group header:
IF IsNull(A) = false then "A"
IF IsNull(B) = false then "B"
else "other"

Got detail sections -> A,B,other. Need to add detail C. details B and C use a same field, table1.field2, but display different formula outputs. Now, how to switch the title going form B to C?.

 

 

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 15 Apr 2008 at 12:45pm

So basically you want C to appear after B?  Or is it a subgroup of B?  Are there details in C?  e.g., Do you want all of the C data to appear after the B data?  Or is it mixed in with the B data like BCBCBC?

<soapbox>
Also,  I would change your group to this:
 
IF not IsNull(A) then "A"
else IF not IsNull(B) then "B"
else "other"
 
Since IsNull already evaluates to True or False, then you don't have to compare it to True or False in order to get a result in an If statement. </soapbox>
 
-Dell
IP IP Logged
rptxyz
Newbie
Newbie


Joined: 24 Nov 2007
Online Status: Offline
Posts: 27
Quote rptxyz Replybullet Posted: 15 Apr 2008 at 1:18pm
<new page>
<title>
B
<new page>
<title>
C
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 15 Apr 2008 at 3:01pm

If the data does not duplicate for C, then the only way I can think of to do this is to use a subreport.  Put it in the Group Footer and suppress when the group is not 'B'.  Lots of folks try to avoid subreports, but this is one of those circumstances where I think it's going to be necessary.

- Use the table(s) that you need to produce the data for C.  Link based on the field for B.

- If the data may run more than one page and you need the C group header on every page, group on the linking field and turn on "Repeat Group Header on Every Page".  Otherwise, put the group header information in the Report Header for the subreport.

-Dell

IP IP Logged
rptxyz
Newbie
Newbie


Joined: 24 Nov 2007
Online Status: Offline
Posts: 27
Quote rptxyz Replybullet Posted: 15 Apr 2008 at 5:06pm
How about if data does duplicate?.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 16 Apr 2008 at 10:58am
What I meant by "duplicate" is that there is a set of "rows" in the data that belong to group C only, as opposed to belonging to both group B and group C.
 
If this is the case, is there an additional field that determines which data is for group B vs. the data for group C?  In that case, you would group on the combination of the two fields and include both B and C in your group name/formula and run the report like that.
IP IP Logged
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