views:

358

answers:

2

Hi everyone,

I'm new to SQL Server reporting services, and am trying to decipher an existing report. It's nothing too bad, but I notice it does have two report datasets defined. (They are generated via separate stored procedures)

I'm trying to figure out where and how the report datasets are linked together so the Fields collection has both sets of columns available and the report has a single rowset to traverse. Is there a section in the report layout where a joining of datasets is defined? I'm using Visual Studio 2005 to design and preview the report fwiw.

Thanks for your help!

+1  A: 

Since I cant see the report. I can at least suggest this. Many use the second dataset for selection values on parameters. Perhaps your report has a parameter that is using the second dataset to display a list of choices for that parameter.

John Hartsock
Hi John--I don't believe it's using the second dataset for selection values, as the Fields collection on the report uses a mixture of both datasets' fields. However, it appears that one of the datasets is being used in the header/footer of the report, whereas the other is in the middle: the details section and several groupings. I guess one question I'm still a little confused on is how both datasets' columns wind up in the Fields collection? What if two columns have the same name?
larryq
Larry, even if two datasets had columns with the same name, the name of the dataset is different. You mentioned using one dataset to populate header and footer content and the other dataset is populating the details. The two datasets are not linked but separate and can be treated separately in this case. Im willing to bet that if you run the query for the dataset that populates the header and footer you come up with one maybe two rows(if there is separate content for the footer).
John Hartsock
John, you're right, they are being treated separately. I'm so new to SQL Reporting services that I didn't realize each report table had its own DataSetName property that could be set. I thought the Fields collection was over the entire report, much like a SQL query can join columns from different tables. Sorry for the confusion!
larryq
+2  A: 

in many conditions we need to use from multiple datasets. usually these datasets get a same report parameter and return the results. for example suppose that you have a report that get you the list of passed lessons by a student. in this report you want to know min and max of this student number. for this report you get a student id as a input parameter and pass this parameter to first dataset and get the list of passed lessons. the second dataset get this parameter too for generating the max and min of student numbers.

both of these datasets get this parameter. may this parameter be the common point of the datasets.

masoud ramezani