Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 SSRS 2008 set parameter value

Author  Topic 

jassie
Constraint Violating Yak Guru

332 Posts

Posted - 2013-10-15 : 18:13:03
In a SSRS 2008 r2 existing report, I am trying to add a new paramerter to the report called @GRADE. Currently the
report runs based upon @Course. Now I want to run the report based upon if the @Course or @GRADE parameter
is selected. Depending which parameter is selected, I want to generate the report in that manner. The following is
a small snapshot of the code in the dataset.

IF @Course IS NOT NULL
WITH Ctudent AS (

SELECT
BCourseSK


FROM
DataStore.dbo.vwBr
WHERE
BCourseSK = @Course

)
ELSE IF @GRADE IS NOT NULL

WITH Btudent AS (

SELECT [grade]


FROM
[DataStore].[dbo].[vwBr]

WHERE
grade = @GRADE


)

Basically either @Course or @GRADE parameter is selected but not both. For this to occur,
I have set the default value for these paramters to be null. From what I have
seen on the internet, setting the default paramter value to null is the same as setting the parameter as
an optional value.

My problem is the way I set the default parameter values to NULL. The query will not pick any values
when the report is executed.
(When run the sql in SSIS manager, the sql is working).

Thus can you tell me what you recommend I do so that the query runs and picks records?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-16 : 02:45:15
Answered here

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/7363099a-ddcc-4009-863f-a83eceae7c1b/ssrs-2008-setting-default-values-on-paramters?forum=sqlreportingservices

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -