Reporting from multiple tables in one report

  • Thread starter Thread starter nmatthis
  • Start date Start date
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
 
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.
 
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
 
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.
 

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

Users who are viewing this thread

Back
Top Bottom