How to have a Reporting Services parameter automatically selected if there is only one


  • 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?

    Wednesday, December 19, 2012 10:27 AM


  • Hi Craig,

    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.

    Charlie Liao

    If you have any feedback on our support, please click here.

    Charlie Liao
    TechNet Community Support

    Thursday, December 20, 2012 2:48 AM