Wednesday, December 19, 2012 10:27 AM
I'm using SQL Server Reporting Services (SSRS) developed in Visual Studio 2010 to build my reports.
If there is only one item in a report parameter drop-down then I would like that item automatically selected. Instead of getting Select a Value and then having to manually a select that item (when it's the only one in the list).
At the moment, I deal with this by having the default value of the report parameter set by a stored procedure that checks the row count of the items in the parameter list and returns a default if there is only one. But this seems like overkill.
Is there a way I can set this in Reporting Services?
Thursday, December 20, 2012 2:48 AMModerator
As per my understanding, your approach is the best one. My opinion for this issue is that we can create two datasets, one is used for the available values, the query looks like:
select cloumnname from tablename
And another one is used for default value. The query looks like:
select top(1) columnname from tablename order by columnname
In this case, the parameter has only one default value. If there is only one item in a report parameter drop-down then the item will be automatically selected.
Hope this helps.
If you have any feedback on our support, please click here.
TechNet Community Support
- Proposed As Answer by Syed Qazafi AnjumMicrosoft Community Contributor, Moderator Thursday, December 20, 2012 3:16 AM
- Marked As Answer by Charlie LiaoMicrosoft Contingent Staff, Moderator Thursday, December 27, 2012 1:12 AM