26
votes

I have an SSRS (SQL Server 2008 R2) report with several parameters. I'm having an issue where one of the parameters is not consistently choosing its default value when the report is first loaded.

Specifically, it works fine in BIDS but works intermittently (works on one server but not another) once deployed to IIS and viewed in IE. By intermittently, I mean it works on the server I deploy it to, but when I copy the RDS file to another server, the default behaviour for my parameter is broken.

Details

The parameter has a series of specified (constant) integer values specified in the Available Values section, which represent a selection of fixed reporting periods. The Default Values has a single specified value, which matches one of the Available Values.

Options: data type integer, no null values, no multiple values, parameter visible, automatically determine when to refresh.

Any ideas why I'm seeing this behaviour?

7
I've discovered my own answer to this question. I'm detailed it here for anyone else new-ish to SSRS who might be confused by the same behaviour. The parameters can be managed separately from the RDL file, and defaults can be overridden once the report is deployed to the server. To manage the parameters on the server: 1. Click on the report name link at top left on the browser page. 2. Click on the Parameters tab at left. 3. Manage the parameters as needed (e.g. set the default value). 4. Click Apply. 5. Click the report name link (large bold text at top) to return to the report.Mark Micallef
If you're still around, might be a good idea to mark the solution as "accepted"Mathieu Guindon

7 Answers

33
votes

That is true, once the report is deployed to the server then the parameters are controlled at the server level.
Once item to note however is if you redeploy the report with changes to the default values THEY WILL NOT be changed on the server!!! The report must be deleted and deployed for the new defaults to take effect.
If you do not wish to delete the report then change the defaults by hand on the Report Server.

13
votes

I've discovered my own answer to this question. I'm detailing it here for anyone else new-ish to SSRS who might be confused by the same behaviour. The parameters can be managed separately from the RDL file, and defaults can be overridden once the report is deployed to the server. To manage the parameters on the server:

  1. Click on the report name link at top left on the browser page.
  2. Click on the Parameters tab at left.
  3. Manage the parameters as needed (e.g. set the default value).
  4. Click Apply.
  5. Click the report name link (large bold text at top) to return to the report.
2
votes

Another solution without having to delete the reports (the issue when you delete the report is the logs are also deleted) is to open the new deployed report with ReportBuilder (Modifier dans le Générateur de rapports).

Just save the report and the defaults values will be changed.

0
votes

lets say your report name is xyz.rdl if you have set default parameter and deployed it to server now, it will not change on the server. i suggest 3 options 1. change the parameter 'Has Default' value on the server, by right click manage on the report 2. delete the report on the server and redeploy it 3. deploy a dummy report or old version report with same name say 'xyz.rdl' which doesn't have this parameter, doing this will erase report parameters on the server, report stays in tact. then deploy your new version report with default parameter, now it should work.

0
votes

I had similar issue. When a report has been deployed to the Server "Without" Default, and you subsequently modify this report in Visual Studio and change the same parameter to have a default, the server will not pickup that the modify report has a default now.

My workaround to this dilemma was to create a dummy parameter and put it to the top of the list. I then redeployed the report with the new dummy parameter and the same modified one with a default parameter. This time the server picked up that the parameter I was interested in as having a default value. I then proceeded to delete the dummy parameter in visual studio and redeployed the report. The parameter that I was interested in remained as having a default value.

I prevented deleting the report and adding subscriptions to it if I had went that route in order to fix my dilemma.

0
votes

It takes a bit of work to correctly handle all the various scenarios, but it is (at least as of Sql Server 2012) possible to update the parameters from a script by loading the .rdl file as an xml file, and comparing it to the various settings available from the ReportingService2010.GetItemParameters method of the SSRS management web service

Based on that comparison, you can then update the parameters on the SSRS server using the ReportingService2010.SetItemParameters method.

Finally, there is a connect issue "Report parameter defaults not updated during deployment" that is a bit more limited in scope to allow just auto-updating parameter defaults.

0
votes

I have noticed this is only a problem when making updates to static parameter values (Value "1"). The expression parameter values seem to a good job of getting updated (Value "=iif(1=1, 1, 0)". Screenshot example included below.

I would suggest using an expression. Or if it's a static value just type that in at the manager page. For example:

//ssrsdev/Reports/manage/catalogitem/parameters/Accounts%20Receivables/Bill%20of%20Lading%20Comparison

Also, I typically deploy my reports using the ReportServerTools powershell cmdlet, so I don't know if maybe their deployment does a better job with updating parameters. So you might try installing and deploying with that tool instead of from Visual Studio.

Write-RsRestCatalogItem

#------------------------------------------------------
# --1,FILES: Add
# Upload file from disk to server
#------------------------------------------------------

 ## TARGET FOLDER
  $rsFolder= "/Accounts Receivables"  #Datasets #Cost
  $rsReportPortalUri= "http://ssrsname/Reports/"
  $locDir=  "C:\MyPath\Solution\Report Project\" 
Get-variable rsReportPortalUri; Get-variable rsFolder; get-variable locDir

 ## SOURCE ITEM
  $rsItem= "Bill of Lading Comparison.rdl"
  $locPath= $locDir + $rsItem 
Get-variable locPath

## Write-RsRestCatalogItem (1)
Write-RsRestCatalogItem -Path $locPath -RsFolder $rsFolder -ReportPortalUri $rsReportPortalUri -RestApiVersion "v1.0" -Overwrite "true" -verbose 

Parameters - "Static" vs "Expression"

enter image description here