Print Page | Close Window

how to link one to many

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12450
Printed Date: 29 Apr 2024 at 5:12am


Topic: how to link one to many
Posted By: denhors
Subject: how to link one to many
Date Posted: 28 Feb 2011 at 9:35am
Hy!
I have a problem when I connect tables (id), I get a report with one result Tb or Tc per details page, instead of an entire column on the same details page.
I have three tables: Ta, Tb and Tc.
Ta - contains id and user name
Tb and Tc - contains various information and ID
example:
Ta:
id name
1 John
2 Franck
3 Anna
Tb:
id data
1 Ford
1 Opel
1 VW
2 Ford
3 AlfaRomeo
3 VW
..
How to link a table to get a list of all brands in the details for each id?
GH
John
Da
Ford
Opel
VW
GF

THX



Replies:
Posted By: DBlank
Date Posted: 28 Feb 2011 at 9:49am

You only described two tables (I assume you are joining them on ID) but state you haev 3 tables. Can you explain more what is in the third tabl and how you are joining it to the others?



Posted By: denhors
Date Posted: 01 Mar 2011 at 5:55am
The third table is like Tb.
Tables associated with the ID, but I get only one result per sheet ...

I get a print like it is in this form:
GH
John
Yes
Ford
Yes
Opel
Yes
VW
GF

... 1 page
John - Ford
2nd page
Opel
3rd page
VW


Posted By: DBlank
Date Posted: 01 Mar 2011 at 5:58am
so
Tb and Tc are structurally the same and each hold one record per person from Ta?


Posted By: denhors
Date Posted: 02 Mar 2011 at 6:37am
Ta is a table with the names and id's.
Tb and Tc contain details and descriptions of users, more equal id in it.
More lines Tb and Tc (same id) is associated with one row of Ta.
Example:
Ta:
id
1
2
3
4
5
:
Tb and Tc:
id
1
1
1
2
2
3
4
4
5
5
5
:


Posted By: DBlank
Date Posted: 02 Mar 2011 at 6:44am
can you union Tb and Tc togther then join that to Ta on ID?


Posted By: denhors
Date Posted: 02 Mar 2011 at 7:57am
Yes, but this is not a problem.
In detail I need to get data from Tb in 2 columns, of course depending on user ID.


Posted By: Keikoku
Date Posted: 02 Mar 2011 at 8:05am
If you join the tables together, you will join all the columns together.

So if each table had 5 columns your final result will have 15 columns.


Posted By: denhors
Date Posted: 02 Mar 2011 at 8:19am
But I get one records per page,
like I have somewhere set trigger and after each records reading from column of Tb go to the new page.


Posted By: Keikoku
Date Posted: 02 Mar 2011 at 8:46am
I was thinking SQL joins and then using a command to retrieve the values. If that is not what you're doing, I am not sure about the situation. If it is, then create a new report, use the SQL, and see your results. If you get everything as expected, then most likely it is the triggers that you're using that's causing problems.



Print Page | Close Window