View Full Version : Reporting from multiple tables in one report


nmatthis
02-20-2006, 01:57 PM
I'm very familiar with taking data from a single table and creating a report in Crystal Reports for this single table. I can use the Detail section to display the fields I want displayed.

But what if I have data from two tables, each of which have different fields or attributes? Lets say I have 3 records in Table A and 4 records in Table B in my report. In the Detail section, I would like CR to display the 3 records from Table A, which it's distinct fields, then under that, list the 4 records from Table B, with it's own distinct fields. I understand that the records displayed from Table A would have their own field headings, and so would the records from Table B.

I thought I could do this by creating multiple Details, A and B, but when I do this, the report only shows one record from A and one record from B. This seems very basic and I'm just missing something obvious. Any help appreciated. Thanks.

Neal

planbprojekt
03-13-2006, 07:39 AM
Wat wud you do , in the case of access..?
create a Query that picks data from different tables and then link that query to the final report.

pravin3032
04-07-2007, 12:10 AM
Create Two subreport on your main report.
In subreport 1 create sql query to select distinct record from Table A
In subreport 2 create sql query to select distinct record from Table B

halem2
05-03-2007, 10:37 AM
if tables have a unique filed (key) you can use to link them together, just do that and pick the fields from the tables as you need them.