views:

255

answers:

2

I'm designing a SSRS report in Visual Studio for use as a local report (so a SQL Server is not involved).

I have a table with customers/addresses that has the following columns:
AddressID
Firstname
Lastname
Street

Another table keeps orders and looks like this
OrderID
CustomerAddressID
ShopAddressID

So two columns from my order table link to datasets in the address table. I want to display both addresses in my report. The datasource for the report is a xsd dataset.

What's the best way to do this in SSRS? I'm pretty new to SSRS and kind of lost with the dataregions, lists, etc.

+1  A: 

You should edit the source for the second dataset to include a parameterized query based on the first one. Something like:

SELECT * FROM other_table WHERE CustomerAddressID = @adress OR ShopAddressID = @address

Ofcourse you should create the address parameter as report parameter(pointing to the first dataset)

Hope this makes sense.

Robert Massa
A: 

Look at subreports.

To be a bit more specific, you need to define multiple data sources in your report that these other regions, tables, or whatever, obtain their data from. You then need callback handlers in your app that can provide that data for each datasource (quoting: "your application must handle the SubreportProcessing event of the LocalReport object.". The article explains this in detail.

Just curious (because I am going to through the same thing right now) - are you really designing SSRS reports (2008), or VS reports (2005)? Because the 2008 ReportViewer control cannot render SSRS 2008 reports ....

cdonner
I added the wrong link - will update when I find the right one.
cdonner
The link is correct now.
cdonner
I'm designing the reports with VS 2005. Thanks for the link.
longeasy
Yes, but if you are just adding a report to a project then you are using the VS Report designer (creating a SSRS 2005 report schema). If you added a Report Server project and created reports in that, you are using the SSRS Report Designer, creating SSRS 2008 schema reports, and those won't render in the ReportViewer control.
cdonner