Print Page | Close Window

Field join

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Talk with the Author
Forum Discription: Ask Brian questions about his books and give him your comments. Like the book? Hate the book? Have suggestions? Let me know!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3965
Printed Date: 20 Apr 2025 at 6:37am


Topic: Field join
Posted By: mrc161
Subject: Field join
Date Posted: 12 Aug 2008 at 1:33pm
Hello.  Can anyone help regarding trying to join fields from two separate records?  It's more complicated than just doing a ToText formula, I believe.
 
For example, I can have three records with one parent account number, but with two "child" account numbers.  So, my records initially show like:
 
Parent           Child
123456         111111
123456         222222
123456         333333
 
What I would like to do, though, is on the report, on one line, reflect it like:
 
Parent          Children
123456         111111,222222,333333
 
 
Any help would be appreciated!  Thanks, Mike



Replies:
Posted By: BrianBischof
Date Posted: 12 Aug 2008 at 2:14pm
The best way to do this is to use a subreport and a shared variable. In the subreport, use a shared variable in a formula that concatenates the Child data into a comma separated string. Hide the subreport so that you don't see all the row data being printed as the formula is calculated. Print this string in the main report after the subreport prints.

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


Posted By: laknight
Date Posted: 21 Aug 2008 at 10:58am
Can this be elaborated on? I don't understand how to accomplish this in the correct syntax code.
 
Thanks.


-------------
laknight



Print Page | Close Window