Groups | Blog | Home
all groups > sql server reporting services > september 2004 >

sql server reporting services : Result set as parameter



Phil
9/20/2004 9:43:07 PM
Hi,

We are having a problem with Reporting Services and are wondering whether it
is a limitation in the current version, or whether we just don’t know how to
implement something. We are attempting to create a report that is based on
information contained in two databases. When the user opens the report, we
want them to be able to enter a skill (i.e. “Maths”), and then the report
will take that skill and query an SQL Server database for a list of IDs for
all Teachers who have that skill. We then want to take that list of IDs and
query on Oracle database for each one, so that we can get information about
those teachers.

A simple example is as follows:

The SQL server contains the following data:


TeacherID Skill
1 Maths
2 English
3 Maths
4 Trombone


The Oracle database contains the following data:


TeacherID Name
1 Phil Price
2 Jed Moss
3 Jack Frost
4 Santa Claus


The user enters a skill (“Maths”), and we want to return the names of all
teachers with that skill. So we query the SQL database for all the teacher
IDs with Maths as a skill. It will return 1 & 3. Now for those IDs we want to
get the names out of the Oracle database. However, we cannot get Reporting
Services to take the list of IDs and, for each one, return the names and
display them to the screen. Is there any way to pass a result set from one
RK Balaji
9/21/2004 7:35:22 AM
Try creating a parameter that is query based against the SQL Server database
where the label field is skill and the value field is teacher id. Once the
user selects the skill, you can query against the oracle database using the
parameter which will now have the teacher id..


[quoted text, click to view]

Phil
9/21/2004 4:05:05 PM
This still doesn't work because it only selects the first value of the result
set. I have setup one query for the SQL Server...

SELECT TeacherID, Skill FROM SkillsTable where Skill = @skill

The '@skill' parameter is entered by the user.

I then write a query for the Oracle database.

SELECT Name FROM Employees where TeacherID IN :id

Now, I want ':id' to be the list of teachers from the first query. So I
setup the ':id' parameter to have the label field of Skill (from the SQL
query), and the value field of TeacherID (from the SQL query). But when then
try running the report and enter 'Maths' as a result, I only get Phil Price's
details back, and not Jack Frost's. I presume this is because it only looks
at the first TeacherID returned from the SQL query. Is this a limitation of
Reporting Services?

Thanks

[quoted text, click to view]
p
11/6/2004 7:22:01 PM
Have you found an answer to your problem. I have a similar situation. I am
trying to pass the result set from a query to a another report (Drill
through). I had the same problem with only the first value from the column
being passed. If you have any other info it would be appreciated.

[quoted text, click to view]
Bruce L-C [MVP]
11/7/2004 10:37:51 PM
Sub reports would do this for you.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

AddThis Social Bookmark Button