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.
Related
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?
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?
At the run time user will select the country for which the report
should run.
Next we will show all states of the selected country on parameter
screen.
Next we will show all cities of selected state on parameter screen.
How can we achieve this?
I'm not really sure, but here's what i think:
Create Your Parameter
Set your parameter value based on others parameter value, and send it to parameter data set to retrieve its data. (maybe you can use expression to do this)
Hope it would help :)
Regards,
David Tan
I could achieve it.
I created first a dataset for my report with Country, State and City fields.
After this, first parameter is country, user will select the country at run time.
After this, I have added another dataset2 to select all the states based on first parameter. I created another parameter to show multiple states. For this parameter I provided 'available values' as the second dataset viz., dataset2. This dataset2 was accepting parameter country and populating the states at the run time. I provided 'default values' as well as dataset2.
This same way I implemented the 'city' parameter. It worked.
Thank you!
Yes we can achieve that.
Let say you have two dropdownlist as a parameters, A and B.
You give A list of data from dataset
for B, you use dataset too to retrieve the data, but when you create dataset for B add filter and set parameter A as its value.
Add Filter for paramater B and set A as its value
Hopefully it would help :)
Thankyou.
Create three different parameters as country,state and city in your dataset and add one line to the dataset query as where country = #country and state = #state and city = #city.
Now coming back to your question, If your sql has duplicate countries,state or cities it wil return duplicate values so create three different datasets for three parameters.Like "Select Distinct country from Person.country" and state is dependent on country so write query for state as "Select Distinct state from Person.Country where Country = #country" and same goes for city.
Hope this answers the question
I am building a report in SSRS 2008 R2 Report Builder 3.0. In this report i have a Parameter named #CustomerID, a list of Customers in a dropdown. I then have a number of Bool Parameters eg. #UseFirstName and #UseLastName which are based on settings for each. The population of #UseFirstName and #UseLastName work fine for the first customer i choose but when i choose a new customer the values are not updated.
Obviously the population the first time is working against the dataset but after that it stops getting updated when i choose customer in the dropdown. Any ideas?
i have set "always update" on all my parameters.
Code for getting the parameter data:
SELECT * FROM pen.CustomerReportSettings
WHERE (CustomerID = #CustomerID)
I don't think the bool parameter radio group will work the way you want it. The only thing I can think of that will get you close is to force the bool parameters to a text datatype and set the default values to "Get values from a query" with the value field being the field related to the parameter. You also need to specify the Available Values as "Get values from query" to force the parameter to reload when the #CustomerID changes. This should yield a drop down box with one selectable option and the value of the dropdown set to that option.
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.