SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 SSRS 2008 set parameter value
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jassie
Constraint Violating Yak Guru

308 Posts

Posted - 10/15/2013 :  18:13:03  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 10/16/2013 :  02:45:15  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000