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


Joined: 24 Nov 2007
Online Status: Offline
Posts: 27
Quote rptxyz Replybullet Topic: help
     Posted: 12 Dec 2007 at 10:01pm

got my CR9 report  working but it has multiple details. do not know how can i insert title for each?.

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 13 Dec 2007 at 12:03am
Can you please explain in more detail? Possibly give an example? Thanks.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
rptxyz
Newbie
Newbie


Joined: 24 Nov 2007
Online Status: Offline
Posts: 27
Quote rptxyz Replybullet Posted: 13 Dec 2007 at 11:30am

having Mytable as:

Column1   column2      I1           I2           I3          I4 
------         -------        ----        -----        -----       -----
c1             c2              I11        I21         null        null
c1             c2              I12        I22         null        null
c1             c2              null        null         I31        I32
c1             c2              null        null         I32        I33


I like report to like:
myLabel1:
c1  c2     I11             I21
              I12             I22
             ----             ---
       sum(I11,I12)   sum(I21,I22)


myLabel2:
c1  c2    I31             I32
             I32             I33
            ----              ----
       sum(I31,I32)   sum(I32,I33)
        

IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 14 Dec 2007 at 6:23am
OK, setting aside the normalization issues with the dataset, as they may be unavoidable...

How do you determine which records should be in myLabel1 and myLabel2?  Are I3 and I4 always null when I1 and I2 have values, and vice versa?  Are c1 and c2 actually different values for each record, or are they repeated for every record?

I'm going to assume for the sake of this post that what you listed is exactly how the dataset looks, and exactly the breakout you want.  I actually find it quite odd, but I'm willing to go with it.

First, you're going to need to separate the data into two groups.  Since you don't have a logical field to group by in the dataset, you're going to need to create one.  Create a formula, @myLabel, that looks like:

IF IsNull({Mytable.I1}) THEN "myLabel2"
ELSE
IF IsNull({Mytable.I3}) THEN "myLabel1"
ELSE
"myLabelError"


Group your records on this formula field.

In the Group Header section, put your @myLabel field.

In the Details section, put Column1 and Column2.  Go into the Format Field dialog on each, and select "Suppress if Duplicated."  Put I1 and I2.  Put I3 and I4 right on top of I1 and I2.  If they really are mutually exclusive, then only the relevant data will appear.  However, if there is a record with, say, a value for both I1 and I3, you will need to create a conditional suppress to only show the proper one based on the group (see below for an example).

In the Group Footer section, create summaries of all four I fields (i.e., I1, I2, I3, and I4).  In each one, go into the Format Field dialog.  Click on the formula button next to "Suppress."  Enter a formula like this for I1 and I2:

@myLabel = "myLabel2"


For I3 and I4, use "myLabel1" instead.  This will suppress the summary when the column is from the wrong group.



IP IP Logged
rptxyz
Newbie
Newbie


Joined: 24 Nov 2007
Online Status: Offline
Posts: 27
Quote rptxyz Replybullet Posted: 14 Dec 2007 at 9:50am

How do you determine which records should be in myLabel1 and myLabel2?

I1 an I2 in myLabel1.
I3 an I4 in myLabel2. etc.
 
Are I3 and I4 always null when I1 and I2 have values, and vice versa? 

yes.

Are c1 and c2 actually different values for each record, or are they repeated for every record?

they change.  it is difficult to give you exact picture but they do change. showing c1 and c2 the same like that is not the case. c1 and c2 change.

IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 14 Dec 2007 at 11:28am
You may need to adjust @myLabel to look more like:

IF IsNull({I1}) = False THEN "myLabel1"
ELSE IF IsNull({I3}) = False THEN "myLabel2"
ELSE IF IsNull({I5}) = False THEN "myLabel3"
etc.
ELSE "myLabelError"

Otherwise, everything I wrote before should work out just fine.  Or, at least, fine enough to give you a good starting point.


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