Saturday, January 7, 2012

SSRS parameter default values not working

Having seen this issue several times on various forums, thought it would be a good idea to blog about it. In some cases, Reporting Services parameters with default values wouldn’t default and so you would have to manually select the values in the parameters. Obviously, this defeats the purpose of setting default values as you are required to manually select the values when running the report.
So what is the reason behind this issue? There could be 2 possible reasons based on my experience:
1. You have NULL or blank values in the dataset you have used to populate the parameter. There are two ways to fix this:
a.    Filter the blank/NULL values using a WHERE clause(example WHERE ColumnName IS NOT NULL AND ColumnName <> '')
b.    In the parameter properties, select the check boxes “Allow blank value” and “Allow null value” as shown in the figure below:
    
2. If the report works fine in BIDS(meaning the parameter is defaulting to the default values) but doesn't work in Report Manager after deployment, then you’ll have to either check the option “Has default” in the report properties in Report Manager as shown in the screen shot below or delete the report from Report Manager and deploy it again.
  

6 comments:

  1. Thank you! Solved my problem!

    ReplyDelete
  2. YOU ARE GREAT!!!!!!!!!!!

    ReplyDelete
  3. Thanks very interesting blog!

    My web-site; recherche emploi design [jobedge.net]

    ReplyDelete
  4. Thank you, Faisal! That did the trick.

    ReplyDelete
  5. Thanks so much couldn't think about this...really appreciate Faisal!

    ReplyDelete
  6. Thanks for the post. Deleting and recreating the parameter was also necessary in my case (hope that helps someone).

    ReplyDelete