Default Values for Parameter not Working in SSRS 2008 R2

Amarundo picture Amarundo · Sep 30, 2013 · Viewed 50.3k times · Source

I have a report (BIDS SSRS 2008 R2) that has a parameter that allows the user to select multiple values from a list (Sales Regions, lets say).

I want, though, since the list is long (15 or so possible values) have selected by default the 2 values that are used the most.

I configure that in the Parameter Properties >> Default Value dialog and when I run the report in preview mode it works, meaning, the default values are checked.

However, when I deploy it and run it with IE9 (or Chrome) it doesn't work.

Any ideas?

Answer

djangojazz picture djangojazz · Sep 30, 2013

I would guess that your build is bad you are deploying and did not get updated from either a change you made or it is not overwriting a value. You can do a few things to ensure default parameter values are there.

  1. Go the published report on the server and click the drop down arrow on the right and choose 'manage'. Now choose 'Parameters' on the left pane. Under the 'Has Default' column (3rd from left on 2008R2 and higher) it should be checked. Then under 'Default Value' it is either a specific explicit input or it will say 'Query based' meaning it derives its value from a dataset or similar manner. If this is different than your value you would expect and is explicit you can just change it here.

  2. If it is query based and you observe that your data cannot be altered here I would go to BIDS and open up the SSRS project under the solution and choose to 'Open Folder in Windows Explorer'. Find your report's DATA file and delete it. Note this is NOT the report itself but a file similar to it like 'report.rdl.data'. This is NOT a step that most likely affects the build but merely the preview, however we wish to see the preview after the rebuild exactly as it would be. Go to your report's project and choose 'Clean' then 'Rebuild' to ensure you are removing all the data files in the bin in addition to the one you did explicitly. Rebuild will now build all the files from the instructions. Now click preview on your report, verify it is as expected with defaults. Publish again and observe.

  3. If this still did not change the report I would guess the updates are not taking. I would rename the report on the server like 'report_old' and try to publish again.

  4. If this still did not take I would check that the publish location we want is valid and we are deploying correctly and that any parameters are not getting data from shared datasets that are not set to 'do not overwrite' or weird edge cases resulting from publishing being halted due to config settings.

SSRS has had weird issues for me in the past with the issue of my files being under source control and then the system not wanting updates to parameters myself. Generally this is fixed with a rebuild but sometimes it does require a new binary file to be published.