Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Problem with linking Post Reply Post New Topic
Author Message
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Topic: Problem with linking
     Posted: 07 Feb 2014 at 4:40am
Hi all,

I have a question. I have a report based on a XML file. Crystal is splitting the different subsections up as different tables, allowing you to link it.

Now I have 1 "table" with phone numbers. The problem is, that a case can have multiple phone numbers. The code for this can be for example "MOBILE" or "FIXED". But it could also happen that there are 2 "MOBILE" numbers. We would both want these numbers. However, when there are 2 numbers, I get 2 lines in my output.

Is there any way around this? I need it to turn out as 1 line, as I need to upload these cases into the database and I don't want any duplicates.

Thanks a lot in advance
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 07 Feb 2014 at 5:10am
do you want both numbers on 1 line?

if so, the classic solution is to group by something, say personID and concatenate the phone numbers in a shared/global variable and display the value in the group footer.
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 09 Feb 2014 at 9:40pm
Hi Lockwelle,

Thanks for your reply. Grouping did fix the issue, stupid that I didn't think of that myself :)

However, how do I concatenate the phone number?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Feb 2014 at 4:54am
shared variables:
reset in group header
shared stringvar phones:="";

detail, increment:
shared stringvar phones;

phones := phones + ", " + {table.phone};
""//hides the growing string

display in group footer:
shared stringvar phones

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