Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Displaying Multiple records into one record Post Reply Post New Topic
Author Message
Inakawa
Newbie
Newbie


Joined: 24 Mar 2010
Online Status: Offline
Posts: 2
Quote Inakawa Replybullet Topic: Displaying Multiple records into one record
     Posted: 24 Mar 2010 at 6:36pm
Hi,

I am facing a problem with displaying multiple records, in one record. I will explain the issue by the following example:

I have a table x with fields Charge, Index, codenumber, etc.
I want to display different charges on one record. These charges are all store on the "Charge" field, and they can be identified/differentiated by their "Codenumber" or "Index"

I want the outcome to be:
First record:
Capacity charges:200
Deposit:500
Admin Fee:300

Second Record:
Capacity charges:400
Deposit:200
Admin Fee:100

Third Record:
Capacity charges:1000
Deposit:600
Admin Fee:400

At the moment the records Appear as follows:
First record:
Capacity charges:200
Deposit:0
Admin Fee:0

Second Record:
Capacity charges:0
Deposit:500
Admin Fee:0

Third Record:
Capacity charges:0
Deposit:0
Admin Fee:300

Fourth record:
Capacity charges:400
Deposit:0
Admin Fee:0

Fifth Record:
Capacity charges:0
Deposit:200
Admin Fee:0

Sixth Record:
Capacity charges:0
Deposit:0
Admin Fee:100

Fourth record:
Capacity charges:1000
Deposit:0
Admin Fee:0

Fifth Record:
Capacity charges:0
Deposit:200
Admin Fee:0

Sixth Record:
Capacity charges:0
Deposit:0
Admin Fee:100

Seventh record:
Capacity charges:200
Deposit:0
Admin Fee:0

Eight Record:
Capacity charges:0
Deposit:600
Admin Fee:0

Ninth Record:
Capacity charges:0
Deposit:0
Admin Fee:400

I have use the following formulas to display the respective charges:

CapacityCharges; If x.Index = 1 then x.Charge
Deposit; If x.Index = 2 then x.Charge
Admin Fee; If x.Index = 3 then x.Charge

Please advise how I can write the formula to get the right outcome.

Thanks.

Regards,
Joyce
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 25 Mar 2010 at 3:27am
if there are just those 3 types of records, I would 1)create a group on the field that is common to all 3 records. 2) created global variables that would hold the values for each part of the index, and increment these variables in the details section.  3) suppress the detail section. 4) in the group footer, create the layout that you want, and create formulas to access your global variables and use them in the group footer.  Last, I would go back to the group header and add a formula to rest all the variables to 0.
 
That should solve the simple problem of the display.  If grand totals or other totals are desired, I would create more global variables; resetting, incrementing, and displaying them as needed.
 
HTH
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