Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a report in Visual Basic 2010

I would like to view data based on two datatables from the same dataset. I manage to get data from one of the tables displayed in the report at runtime, but cannot see the other details from the other datatable.

Is there a way I can view the details.

I have placed the first table (MainData) in the header and the footer of the report

The DetailsTable I have placed data in the report detail section of the report.

When I run my program I get the Header and footer data displayed but not the details, I only see the column headings. Could someone help me out there.
Posted
Updated 24-Jul-11 13:27pm
v2

1 solution

If you don't have a relationship between the two tables, I suspect your report design isn't going to show much at all.
 
Share this answer
 
Comments
SimbarasheM 28-Jul-11 11:44am    
Hi Dave

I have two queries defined in SQL Server and they are then refined i.e. I use parameterised queries in my Dataset in VB.Net.

I have defined the relationship on the two DataTables based on say invoice number field.

What I would like to view on my report is as follows:

1. Table A contains the data I would like to display in the Header section of my report

2. Table B contains the data I would like displayed in the details section when the report runs.

However when I run the report I only get values from Table A and just the column headings for the Details with no data displayed.

How do I ensure Table A is displayed and then also the results of Table B are displayed.

Thanks
Dave Kreskowiak 28-Jul-11 18:34pm    
The reason why it doesn't work is because you don't have a relationship between the two tables. The DataTables need to be in a DataSet and have a DataRelation object added to the DataSet that describes the related fields. It's called Master/Detail.
SimbarasheM 31-Jul-11 7:56am    
Hi Dave

Thanks for your responses I have found a solution available on this link http://www.codeproject.com/KB/reporting-services/1tomanyreports_vsnet2005.aspx

For anyone requiring the same results

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900