Cascading issue in SSRS - reporting-services

I have SSRS report in which for parameter I have done the cascading, like I am having country parameter and state parameter, so if I select only the country 'US' then the state parameter is giving me only the states of 'US' and all those states are automatically getting selected but now if I select the 'All' in the Country parameter then in dropdown of states all the states are coming(including that of 'US' and other countries) but they are not getting automatically selected. How to make them automatically selected?

Related

Report parameters to display values according to condition in ssrs reports

I have a report parameter #Filter Report and the dropdown values available in this filter are None, CustomerID, CustomerData
CustomerID - If this option is selected , a text box will appear where the user must enter the numeric value.
CustomerData - If selected the user will be presented with two text boxes Name and Age
if none selected then nothing will appear.
Many thanks in advance

SSRS cascading parameters with 'Allow Null' - enable only when selected param value is not null

I am implementing SSRS cascading parameters:
Country
State
City
Each of the above params gets the 'available values' from respective datasets. There is no default value set.
Each dataset has got the respective values and an additional record with label 'All Values' and value NULL. I am cascading the country value into state; and country and state cascade into City to populate appropriate values for City. This is working fine.
The params are of type text and are configured to not allow nulls, not allow blank and not allow multiple values. In the report preview I can see that it asks me to for the country param, and the other 2 params are disabled. When I click on view report, it forces me to select the value for Country following which it populates the State and only when I select state it populates City and then once I select City it allows me to run the report.
However, when all the parameters have their settings changed to 'Allow Nulls', the dropdowns are pre-populated with the foll. value - 'All values'. This is because NULL = 'All values'. This Country value get auto passed into State as null and hence State dropdown shows as 'All values' and similarly, the city dropdown.
Question: I need the Country dropdown to initially show 'All values' (null). However, I would like to disable the State and City dropdowns unless the Country value is changed to something other than 'All values' (null). And while the State and City dropdowns are disabled, I would like that the State and City param value is NULL and should allow me to run the report (because the child param will anyways has 'All values' (null) as preselected and the only available option). So effectively I need to be able to run the report along with the enable/disable effect that cascading gives. Is this possible in SSRS?

SSRS report Paramenter Refresh

I have a SSRS report, contains 'State' and 'County' as parameter.
In a scenario, state->CA(California), selected and all the counties are selected in County filter, belongs to CA.
Now User selects a few other states, the county filter is refreshed with new list, corresponding to states, but they are un-selected/unchecked. Only CA counties are checked/selected in drop down list.
Can I have a fix to slect all counties all time whenever refresh of states happens.
Thanks,
Varun
to set Select All as Default value, you have to set the parameters "default value" to use the same query as the "available values"; Like If you are getting value from Select ID,CountryName From [Country] where [StateID]=#ID then use same query to set Default Value.

Hide parameter (dropdown control from the toolbar) in SSRS based on another Parameter

I'm using .NET ReportViewer control.
We only want to display the "Dealer" dropdown if user is admin.
Is it possible to hide the "Dealer" dropdown control based on another parameter passed in, like IsAdmin?
The Hidden property of a parameter can only be True or False so you can't have an expression that changes the visibility dynamically.
However, what you could do is make the #Dealer parameter's available values restrict choice based on the logged in user. For example, let's assume that each user belongs to a dealer but administrators can see all dealers. Make the SQL for the #Dealer parameter's available values be something like:
SELECT DealerId, DealerName
FROM Dealers
WHERE #UserId = 'Admin'
OR DealerId IN (SELECT DealerId FROM Users WHERE UserId = #UserId)
Now the parameter will show all dealers when the user is Admin but only the specific dealer for that user when they are not. Default the parameter to the user's dealer and you are good to go.
#UserId is a global parameter for the currently logged in user.

SSRS 2008 R2 chained parameters

I have a report with three parameters: A country combo box, a start date and end date (of the fiscal year). I want the start date and end date to be updated depending of the country combo box selection.
I made a dataset that receives the country code as a parameter and returns the start date and end date for the selected country. Then I linked the default value of the dates to the dataset.
This works perfectly the first time a country is selected but not for the subsequent country selections. If I change the type of the dates parameters to combo boxes it works every time but I don't want to lose the flexibility of "fine tuning" the dates after the country is selected.
am I asking the impossible?
Microsoft regard this behaviour as being by design - see this Microsoft Connect issue.
There is a workaround in general - the dependent parameter gets refreshed when its values are invalidated by the selection in the first parameter.
However, since you want the users to be able to override the start and end dates, you can't specify that the default values for the country are to be the only values available.
What you could do would be to add a second country parameter after the first, whose default and only available values are the value of the first country parameter, and to set the default values of the start and end parameters based on the value of the second country parameter.
Unfortunately, if you set the second country parameter to be hidden, its default value does not get populated - so the second country parameter would have to remain visible, for this to work.
You could make use of this - for example, by displaying the default date range for the country as the label for the parameter; this would enable the user to see where the default date range has been overridden.