Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Showing mutiple data in 1 row. Post Reply Post New Topic
Author Message
arungupta
Newbie
Newbie


Joined: 28 Feb 2011
Online Status: Offline
Posts: 1
Quote arungupta Replybullet Topic: Showing mutiple data in 1 row.
    Posted: 28 Feb 2011 at 7:28pm
I have two table
1. Table1 with fields col1 (primary key) and amount.
2. Table2 with fields col1 (Foreign Key) and Col2.

e.g.

Table1                    Table2
Col1   Amount             Col1      Col2
----   ------             ----      ----
X      100               X        ABC
                          X        MNO
                          X        123

Now if try to generate the report by joining these two tables on col1, I have below structure:

Col1        Amount        Col2
----        ------        ----
X           100            ABC
X           100            MNO
X           100            123

Now the problem arise when try to show the summary of amount. This sum comes as 300.
Can someone help to have summary as 100?

Also appreciate if we can show the data in below format:

Col1        Amount        Col2
----        ------        ----
X           100           ABC/ MNO. 123

Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Mar 2011 at 3:05am
use global variables
 
you can use them for both the conditional summing and for the display, they will most likely be used as a group of 4 formulas.
1 - reset the variable, usually in  a group header
global numbervar nAmount :=0;
global stringbvar sDesc := "";
 
1 - increment (usually in the detail section) (for this example, I would suppress the detail band, as we are summarizing the transactions)
global numbervar nAmount;
global stringbvar sDesc;
 
//logic to determine when to increase the amount
//logic on how to create the string you want
 
2-display formulas (usually in the group footer)
1 like:
global numbervar nAmount;
the other like:
global stringvar sDesc;
 
drop the formulas in the correct bands and it should work.
 
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.