Default Values for Parameter not Working in SSRS 2008 R2 - reporting-services

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?

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.
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.
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.
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.
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.

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.

I also was facing this issue.
Deleting the report, and reuploading it by changing the name, worked for me.

Related

SSRS Hidden parameter results in "Parameter X is missing a value"

First I would like to apologise for any mistake and misuse of the english language as it is not my natural language.
I built a few reports using SSRS. Each one are feeded through different stored procedures.
Each stored procedures has two parameters: id and date. When I display the report the parameter I only want to be visible the date that will be supplied by the user. The id should be hidden and with the default value of 1. So, I turned the parameter id to hidden and set up a default value with the value 1. Im setting the default value on a report's definition level instead on the datasets used to feed the reports. PLease see below the steps I have done:
enter image description here
enter image description here
I've been through some websites(stackoverflow included) and I've seen similar issues. I followed the suggested tips but still no success.
Any help on this will be very appreciated.
Thanks
P.S. Im using VS2015 to design the reports and SQl Server 2014.
Without knowing more, my first instinct suggests that you have your parameters ordered incorrectly. If you have a parameter, P2, with a default value that is processed after a parameter without a default value, P1, and both parameters are hidden, then the report will fail citing that P1 is missing a value.
See my screenshot below as an example. You need to make sure that the parameters are loaded in the order, vertically, that they should be processed, especially if one parameter is dependent on another. Take a look at the ordering and leave a comment if you need further information.
Revised based on Response in Commments
Try opening the report manager via the Report Server web interface (http://[serverName]/[instanceName - reports is default]/Pages/Folder.aspx?ItemPath=/[directoryOfReport]). Click on the dropdown list beside the report name and choose manage. Check out the parameters tab and make sure the default is set properly. Sometimes, if you've messed with parameter properties numerous times in BIDS or report builder, the settings won't translate onto the server itself. Let me know if that fixes it.

how is ssrs parameter getting set?

I have an ssrs report that uses a Shared Dataset to extract a maximum datetime value that I want to use for multiple reports. I have created a shared dataset called MaxSnapshotDateTime.rsd that uses the query:
select max(snapshot_DT) as snapshot_DT from dbo.SystemLog (nolock) where sync= 1
My report dataset Snapshotdatetime uses the shared dataset. And my parameter #snapshotdatetime takes available and default values from the Snapshotdatetime dataset. I want to be able to use this #snapshotdatetime parameter for embedded datasets.
The #snapshotdatetime parameter is the first in the list of parameters. And the Snapshotdatetime dataset is the first in the list of datasets.
When I preview the report in SSDT it displays correctly initially. But once I select View Report the snapshotdatetime parameter displays as a dropdown with "Select a Value" as the default value and my snapshot datetime available in the dropdown.
If I set my available values for the parameter to be None then I get different behaviour: the parameter appears correctly but it is not available for other dataset queries.
Unfortunately I don't have sufficient permissions for a trace. And I have been unable to replicate with another source. Can anyone shed some light on what is happening when View Report is being clicked?
I am taking a wild guess here, but I have faced such issue before and have done lot of head-scratching. Turns out there is a rdl.data file in the solution where the rdl file resides(and it gets created automatically). This is the cache file for the report. When you "Preview" a report, the data and design for the report is fetched from this cache file, not the actual dataset. Hence there are chances it might be stale.
If you really want to see the report's output, instead of previewing it, try running the report from solution. That would be much more reliable.
Hope it helps you.

SSRS - Delay Dataset queries

So, I have my report written and all is well. However now I have deployed to my live environment I have a problem; when the report is initially opened it runs all the dataset queries, as I have a large database the report is taking an age to display.
Is there a way to prevent all queries running when the report is initially opened? Would like to run just a single dataset query the populates my first parameter, so the user can begin to filter the data before selecting "View Report" to run the main dataset query with the parameters applied rather than getting everything the instant the report is opened?
I have tried setting default values in the parameters to reduce the initial data load but this seems to have confused the users, so think a blank report with nothing selected in the parameters to start with would be better.
Thanks
FTD
I assume you have some form of following.
QueryLookupState -- Used to fill dropdownlist etc.
QueryLookupCity -- Used to fill dropdownlist etc.
QueryMain , your main query which uses parameters from above.
You gave default parameters to your report therefore SSRS is using that defaults and running your main query to generate report. Change your main query and default parameters so that your main query bring empty result or main query needs parameters from lookups.
You can look following question and answer for same problem. You need at least one non-default parameter, otherwise SSRS will execute your report when it first opened.

SSRS - filter existing dataset

I have a report that uses parameters. The default parameters are defaulted to contain all available values, so by default the report the contains all possible data.
I want the user to then be able to deselect some of the values in the parameters, and to refresh the charts in the report, so they can drill down to the data that interests them.
But each time the report is refreshed, it runs the query again, slowing down the process.
Is there a way to allow the user to filter the data in the charts, without re-running the query?
I did find this, but it seems that he also didn't get a solution, or I didn't understand how the solution would work.
http://social.msdn.microsoft.com/Forums/en-US/0f905bdb-b8f2-4d9d-ac5b-e85d2f94f0cf/textbox-action-to-filter-existing-dataset-rather-than-rerun-query
To keep the query from running again, two high level steps must happen:
1) Make sure that your filters(parameters) are not included in the query. The query needs to be identical, no matter what the user has selected for a filter. This is done by moving the filters into the report. You can set them up as the filter on the tablix or on the row groups that are displaying the data.
2) Set up caching for the dataset. The easiest way to do this is by pulling the data set out of the report and create a "Shared Dataset." when you upload that to SSRS, define the dataset caching: maybe set it to last an hour. Connect the report to the shared dataset as well.
The full details of this can fill an article, such as http://www.mssqltips.com/sqlservertip/1919/how-to-enable-caching-in-sql-server-reporting-services-ssrs/ (for an old version of SSRS, but these concepts haven't changed much.)

SSRS 2008: is it possible to make a report parameter NOT query-based for some linked report?

I suspect the answer is no, but here goes..
I'm using the WebForms Report Viewer on a public-facing website to allow users to report on themselves or their users (if the user is an admin user).
A report has a parameter called Users where an admin can pick a user from the list and generate a report from it. Mundane users can also view this report, but I programmatically create a linked report for each user and set the UserID value to their ID so they can only view themselves.
This works well except that the UserID parameter is query-based, and not every user is visible in the list using default settings (the user list is based off date range parameters can provide, and only users we consider 'active' during the date range are visible).
This is blowing up for mundane users that are not active for the default date range (which is the previous month).
I suspect the flow of execution is something like this:
Report loads with default parameters
The linked report rules are now applied and the value of the UserID is overridden with the ID in the linked report
UserID field is now hidden to prevent the user from changing it
SSRS can't find the UserID default value in the query results (that I didn't even want it to run) so it displays an error The 'UserID' parameter is missing a value
Through some testing I've found a perfect correlation between users not inside the default date range and users who can't view the report.
Can anyone suggest a way to make the report usable for those users that aren't in the default list? The reports are created programmatically so I do have a fair bit of control over the situation.
I would love to simply be able to mark a parameter in a linked report as no longer being query-based, but those properties are all read-only.
I really, really don't want to have to create duplicate reports to accommodate these users but I'm at a bit of a loss right now.
Any suggestions are greatly appreciated!
Go into parameter section of linked report.
Disable 'Has Default'
Click 'Apply'
Re-enable 'Has Default'
Click 'Apply'
and you're good to go!
I haven't figured out yet how to re-enable 'Query Based' as a default after removing it :(
Would be very much obliged had you found out......
Can't you just mark the param as 'nullable' then pass null in from the linked report ( you may have to alter the back end to cope with this?
Alternatively add an extra row to the 'users' day something like -1 "unknown user" then you can just watch for -1 and handle accordingly