Reporting from multiple tables in one report (1 Viewer)

N

nmatthis

Guest
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

Registered User.
Local time
Today, 21:17
Joined
Mar 3, 2006
Messages
14
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

New member
Local time
Today, 19:47
Joined
Apr 5, 2007
Messages
5
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

Registered User.
Local time
Today, 11:47
Joined
Nov 8, 2006
Messages
180
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.
 

F.I.G.

Registered User.
Local time
Today, 08:47
Joined
Mar 4, 2012
Messages
29

The result from that short tutorial is close to what I am trying to achieve with the exception that I have an additional table (for exemple OrderComment). Its has OrderComment_customername, OrderComment_date and OrderComment_Comment, I would like all comments to be inserted between costomer and date of the report. Is this possible?

Thanks
Van
 

Attachments

  • vb_net_crystal_report_from_multiple_table_10.gif
    vb_net_crystal_report_from_multiple_table_10.gif
    23.6 KB · Views: 1,538

Users who are viewing this thread

Top Bottom