Domanda

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?

È stato utile?

Soluzione

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.

Altri suggerimenti

I saw the same thing this week, and it turned out to be because there were values in my multi-valued parameter's "default list" that were sometimes NOT in the data selection -- in my case, the default list's values were invalid for some dates I might select.

Here's what caught me: SSRS allows invalid values in the default list during development previews, but does not allow them in production.

In my example, the report was being developed in Report Builder. When I did a "Run" (a preview) of the report in Report Builder, the list parameter's checkboxes were selected for the default list's values, as designed. But when I saved the report, and ran it as a user would -- running the report from the Reporting Services browser page -- then no values were selected -- no defaults.

Then, to fix this, I took all selection criteria up to that point, and applied them to the default list -- making sure the "Default Values" only included values within the "Available Values" -- then the default values were selected, BOTH in Report Builder development, and in SSRS production.

EXAMPLE: assume my selection query for "Available Values" was:

SELECT Type
FROM MyTable
WHERE Date <= @BEG_DATE
  AND Date >= @END_DATE

And assume that, using 1/1/2013 and 12/31/2013 as dates, that the above returns 'A','B','C','X','Y','Z' as the list of values, for the user to select from (presented as checkboxes).

Now, assume that my selection query for "Default Values" was:

SELECT Type
FROM MyTable
WHERE Type IN ('A','B','G','H') 

The problem in this example would be that, for dates 1/1/2013 and 12/31/2013, the default values "G" and "H" are not valid values.

The fix in this example would be to add to the 'WHERE' clause, in the "Default Values" query. It becomes:

SELECT Type
FROM MyTable
WHERE Type IN ('A','B','G','H') 
  AND Date <= @BEG_DATE
  AND Date >= @END_DATE

Now, when this default values query is run for dates 1/1/2013 and 12/31/2013, the "G" and "H" drop out of the default values, and leaving only "A" and "B" as default values. "A" and "B" can both be selected, because they are also both in the Available Values for the parameter. So, defaulting the multivalued parameter now works, BOTH in development, and after saving the report (after deploying, after publishing) and running it from a browser.

I had this same exact issue today. I had two reports on SSRS 2008 R2 (sharepoint intergrated) and when I set one parameter to have a default value the change would not take no matter what I tried. It was working fine in BIDS (VS 2012). I even updated a label to verify that my changes were being uploaded to the server. I finally had to remove the reports from the server and upload them fresh again before the default value would work.

I had a similar issue, except that defaults were not even populated in preview mode.

The problem was that one of the codes being loaded from my Default Values query was not present in the Available Values query

For example, code 2000 was in the Default Values query but not in the Available Values query

Result: none of the default values are selected

Once I fixed my population query, all of my default values were selected.

Go figure.

I have also encountered with the same issue today. (23rd June 2016)

Reason: Once we upload/deploy same report on report server, then the parameters default values and default some properties are controlled at the report server level.

Solution: If you redeploy the same report with any utility like reportsync you must be ensure that you first delete all those reports/single report for the defaults values to take effect and then do sync operation.

Note: Before you do this take backups of all SSRS Report using same utility you use. Because sometimes your operation may get fails due to time out error or due to some server issues.

Alternate solution: If you have very few reports and you don't want to delete those reports then change the default values manually by going to Parameters Tab and tick the Has Default. That's it.

Hope this will help to all SSRS Developer.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top