SSRS Multi Value Parameter - Deselect a parameter on selecting another parameter - reporting-services

Is it possible to deselect a certain parameter in SSRS multi value parameter report when a different parameter is selected?
Consider the above image as an example. I want this work in such a way that, when I select DEFAULT parameter, all the other parameters should be unchecked whether it was already unchecked or not.
Same way, when any other parameter (VAL1, VAL2, VAL3) is checked, DEFAULT should be unchecked.
I just know 1 way which includes a complicated set of code in each of the parameter values.
Is there a simpler way to achieve this? Any help would be appreciated. Thanks in advance.

Related

SSRS "B" Parameter change to default after change in "A" parameter

I have SSRS report with several parameters (based on SSAS cube). All parameters has own default values. For example there are 3 parameters.
At first I change 1st and 3rd parameters to another value. After that I change value of the 2nd parameter. But after that the value of the 3rd parameter changes also - to its default. But the first parameter will stay the same. There is some dependency in order - if I change 2nd parameter, the 3rd parameter will reset itself to default.
Is there any chance to avoid this situation? I want keep the value of the 3rd parameter same as I defined.
There is no connection between those parameters
Thank you for your help
Ondra
On Parameter properties, in advance tab select option as to not refresh, check below screenshot

How to force an SSRS parameter to be grayed out using an expression?

Looking everywhere on Google and cannot find the answer.
Is there an SSRS expression to grey out a parameter. So by default it is visible and can be selected. I want to to be grayed out and not selectable until a prior parameter is selected. I'd like to do this with an expression instead of cascading parameters. This is a special case. There must be something I can do in an if statement to make the parameter grayed out if the other parameter does not have a value selected. Please help.
You dont have to give always a value to the parameters from the form in the preview or by using parameters in cascading but maybe a default value from behind. It would depends on your code and what do you need to return for the dataset. I suppose that the dataset has fixed columns. Do you use sql inline or a store procedure? can you give an example of your code?

SSRS Use 1st Parameter (Multi choice) or 2nd Parameter (Text) for same SQL Parameter

I'm not sure if this is possible, but I would like to use 2x Report Parameters for the same SQL parameter.
Currently I have the following in my WHERE clause which relates to a multi-select drop-down:
and traderid in(#traderid)
But I would like to have something along the lines of:
and (traderid in (#traderid) OR traderid = (#traderid2)
so that users can either type the name that they require as opposed to finding in in the vast drop-down list, or choose multiple traders from the drop-down.
In trying so far, I cannot leave the multi-select blank as SSRS will not run the report and you cannot specify the 'Allow Null option' for multi-select parameters.
Does anyone know if there is a way around this?
You need to add a value to your multiselect parameter that effectively means "Ignore this and use the text box".
For instance, add an option to the multiselect with value -1 and label -Enter Manually-.
In your query, do this:
and (traderid in (#traderid) or (-1 in (#traderid) and traderid = #traderid2))
The above assumes your traderid is integer. If not, adjust accordingly.

Parameter is missing a value ssrs 2008

I have a parameter of integer datatype which is hidden. When i run the report, report gives me an error
Parameter X is missing a value
However if i make the parameter visible it works. I tried providing default value of 0 but that does not suffice my requirement as i have sub-report(Drill-dowm) depended on this parameter. Please help. Thanks!
Make sure that you have not specified Available Values for the parameter. Available Values should be "None" for internal and hidden parameters.
First of all,
Check that parameter's - Available Values by going to report parameters properties.
It must not be specified any values. So we should set it as None
Second work around is,
Just add a blank space at Specify values - in Default values inside report parameters properties.
This will surely work. Hope it will save your time.
I had to do an "if exists" statement for this to go away. It worked for me because it makes it always return a value even if that value is not need by my query.
if exists (my select query)
my select query
else
select '2'
// '2' would never be used, but it made ssrs stop giving me
// the stupid error and execute the rest of the query
If you specify available values from query, then default values must be in list of available values. Default value in (Available) = true.
The problem occurs also, if you have a parameter that depends of another one without "default value" inside the Dataset Query and does not admit null value.
For example:
Parameter 1 have a default value: NameEmployee from the dataset "EmployeeSearch"
But the dataset "EmployeeSearch" have a filter or a parameter inside the query named #Month that indicate the number of the month. So if the value of #Month is null, SSRS will say "Parameter is missing a value".
Assuming you had the same issue as I had, trying to run the report on a web page using a ReportViewer component, I managed to fix that issue by adding a null parameter before rendering the report:
C# code:
var parameters = new List<ReportParameter>();
parameters.Add(new ReportParameter("ParameterName", (string)null));
ReportViewer1.ServerReport.SetParameters(parameters);
Hope that will help
Just need to add 1 default value to get around this error (even though that default value will never be used).
-Under "Report Parameter Properties" for that specific parameter, go to the Default Values page.
-Toggle "Specify values"
-Add a value (I added: "just_a_filler_to_get_around_hidden_value_error" so when I look back at it later I remember why I did such a thing)
-click OK
I want to add to dmbreth's CORRECT answer.
I was missing the concept that the value of the parameter still needed to be tied to something. Originally, I was tying the output of a dataset by using the Available values portion of the parameter properties, but according to dmbreth's answer, that could not be the case. Finally I moved my output dependence settings from the Available Values section to the Default Values section and that did the trick.
So, in summary, in the parameter properties dialogue:
General Page - Allow multiple values checked(this option is specific to my application), parameter visibility set to internal
Available Values Page - None
Default Values Page - Get values from query, [appropriate dataset, value here]
Advanced Page - No significance here
Hopefully, that is clear enough to benefit someone else with the same problem...
I had a similar issue where the default value as set by SSRS is (Null), I didn't need the parameter for my report however; I found it useful for testing to filter down the list so I kept it, I guess I could have deleted it in SSRS on the dataset config. but I changed it to =System.DBNull.Value (I guess this could be any expression) instead and that worked for me, so then I can still pass in a value if need be and also set Available values (had to make sure a NULL value was added to my dataset) if I then decide to unhide at a later date.
There is one other potential here. I have had a situation where the report designer works but the server report object does not. The solution is to delete the server object and then re-save it from the designer.

SSRS: Can I know if user selected "ALL" in multivalued param?

Customer wants me to repeat the parameter values in the page header of the report. But if they just choose "Select All" on a multi-valued parameter, they want the text "Any" listed.
For example, one parameter has a fixed set of 9 values. I hard-coded the expression for a text box to:
="Room Size: " &
iif(Parameters!pRoomCap.Count=9,
"Any",
Join(Parameters!pRoomCap.Value, ", "))
How can I do this if the parameter source is a query of unknown size?
Try this out. You need to compare the total number of parameters in the dataset to the count of selected parameters. The following assumes that your multivalue parameter is using a dataset called "dsRoomSizes"
="Room Size: "
& iif(Parameters!pRoomCap.Count = count(Fields!pRoomCap.Value,"dsRoomSizes"),
"Any",
Join(Parameters!pRoomCap.Value, ", "))
This expression will work in the page header/footer.
UPDATE
In the interests of finding a solution to your problem, the following should work for you. It feels hackish and I encourage you to keep research alternative methods but this will work:
Create a second multivalue parameter and name it something like "pRoomCap_hidden".
The source of the parameter is the exact same query
In the parameter properties, setting the default values to the same query
Important: Set the parameter visibility to hidden
This will create a second multivalue parameter in your report that is exactly the same as your initial multivalue parameter only this parameter list will have all values selected by default.
Enter the following expression in a textbox in your header:
=IIF(Parameters!pRoomCap.Count = Parameters!pRoomCap_hidden.Count,"All",Join(Parameters!ReportParameter1.Value,", "))
The above will compare the selected values in each parameter list. If the lists contain the same selected values then that indicates that "All" have been selected in the first list.
Like I said, it is hackish but it definitely works. Until you are upgraded to 2008, this might not be a bad workaround for you.
Can you compare the count of the parameter to the count of the dataset you pull the parameter values from?
I unioned my dataset for the parameters with one which I created manually with a "select" statement - I was then able to force the value to be something like -1 or null.
Then simply check if the parameter contains -1 or null and replace the value in the header with the replacement text.
BTW- I am now using SSRS 2008 R2 and this solution worked for me. My report uses three datasets; but only one in the tabilx that I needed to hide a row in. After long hours of searching and many, many, many unhelpful for wrong answers; the solution of creating a identical parameter only hidden (I marked it as internal) and then comparing to the exposed one is brilliant and easy.
Thank you very much!