| Author |
Message |
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|

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 Logged |
|
|
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

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 Logged |
|
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|

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 Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

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 Logged |
|
|
|