Print Page | Close Window

Joining 2 records

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1635
Printed Date: 08 May 2024 at 1:38pm


Topic: Joining 2 records
Posted By: cottie
Subject: Joining 2 records
Date Posted: 07 Nov 2007 at 12:20am
Hi!
 
I am new in this forum hope everyone is willing to help me.
 
I am having a problem with my report. I wanted to combine two records in one column. Here is a sample column in my table
 
Org_ID            Company       Contact
1                           ABC              --
1                                               maria
2                            XYZ              --
2                                                Don
 
With that I wanted my report to look like this:
 
Org_ID          Company                             Contact
     1                  ABC                                     maria
     2                  XYZ                                      Don
 
Is it possible to do it? I am using Crystal Report 9.
 
Thanks for your support.



Replies:
Posted By: MRVbnet2005
Date Posted: 07 Nov 2007 at 12:39am
u create store procedure that joining in sql statment


Posted By: cottie
Date Posted: 07 Nov 2007 at 1:22am

My back end is dbase.



Posted By: BrianBischof
Date Posted: 08 Nov 2007 at 12:13am
This would require a tricky formula. I would save the Company field to a global variable. Then suppress the Detail section when the Contact field is empty. When the contact field isn't empty print the value of the variable that is storing the Company field.

That way the first record will always get suppressed and only the second record gets printed. The second record will print the company name with it since it is pulling the data from the previous record that was stored in the variable.

-------------
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: jkwrpc
Date Posted: 08 Nov 2007 at 2:00pm
Does dBase support SQL queries?  If it does,  you could write a query that simply grouped the data? I dont have a copy of dBase or similar xBase database,  which is why I can't answer the question myself. 
 
Failing that you may be able to create Command Objects pulling the Id and CompanyName in one and then the Id and Contact Name in the other then use the Database Expert to link the two command ojects by  the Id?
 
I also do not have v.9 so I dont know if did not have the Command Object functionality.
 
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net
 
 



Print Page | Close Window