Dynamic DataSet in SSRS
hi Guys
Can i design a set of reports that has the same .rdl file, the field names for these reports are same, but the dataset query that will provide the data to this report is retrieved from a table by a common stored procedure.
The dataset will query different tables depending on the need, but the field names are same.
Thanks
November 11th, 2010 9:00am
You can write you store procedure in such way that returns the rows you need depending in a parameter, something like this (your store procedures should return the same rows)
create procedure DifferentResultSet
(
@SelectResultSet int
)
as
if @SelectResultSet=1
BEGIN
exec sp_lock
END
ELSE if @SelectResultSet=2
BEGIN
exec sp_who
END
and use that store procedure as your dataset
Free Windows Admin Tool Kit Click here and download it now
November 11th, 2010 12:34pm
You can write you store procedure in such way that returns the rows you need depending in a parameter, something like this (your store procedures should return the same columns)
create procedure DifferentResultSet
(
@SelectResultSet int
)
as
if @SelectResultSet=1
BEGIN
exec sp_lock
END
ELSE if @SelectResultSet=2
BEGIN
exec sp_who
END
and use that store procedure as your dataset
November 11th, 2010 8:31pm