How to set report parameter properties based on previous parameter value - reporting-services

How do I set the selecting of a report parameters in ssrs to default to a different selection based on options selected.
I have a report that have up to 5 radio buttons in my parameter field and the query is such that if one value is true another should be false so users want that when they select a certain radio button, another should default to false.
In Chose default value for this parameter I used a switch function but not getting it right. Please help

I don't think you can do this in SSRS. I'd take care of this in drop downs so you can pass in a parameter to a query to dynamically change what will appear, even if it's just two vaues.
You do this by:
1) Add queries for parent and child datasets
2) Add parameters for parent and child, getting available values from the datasets
3) Reference parent parameter in child dataset
The parameters will now cascade.

Related

Enable Selection of only two values in SSRS multiple select parameter

I have a SSRS report in which i have a parameter which comes in a dropdown it is a multiselect parameter, now i want that at most user should be able to select only two values from the dropdown.
Although you can't stop the user from selecting more than two values, you can keep the report from being shown if they do. First, I created a red-text textbox at the top of my report that holds an error message. Something like:
You selected more than two values for ReportParameter1, try again...
Then, I set the visibility of this message with an expression (for hidden) set to =(Parameters!ReportParameter1.Count<=2). Now this error will show only when the user has selected more than two parameters.
I then hide the content of my report with a visibility expression of =(Parameters!ReportParameter1.Count>2). Note that you can simply put all your content in a rectangle and then hide the rectangle.
If your user selects more than two parameters, only the red error message is shown. If they select two or less, everything looks normal. I would also write your stored procedure in a way so that if a user selects too many values for the parameter, it won't return any data.
This is not possible. A multi-select parameter is that and just that: a parameter that lets you select multiple values.
If you will always only have two values that need selecting, the easiest way of implementing this would be to have two single value parameters labelled as Value 1 and Value 2 which are then both referenced in your report query.
There are workarounds as suggested by #Kyle Williamson in his answer, but there is no exact answer possible as this facility is not present in SSRS

ssrs forward parameter and available values

I have a drill down report in ssrs. Trying to pass the value of a parameter from parent report to child. Now in child report i already have a set of available values for that parameter. What i am trying to achieve is, when the child report loads the default value should be the one I am passing from the parent report and the report data should get loaded based on that and after the initial load the user can select form the drop down and refresh the report. For me the problem is when the child report is getting loaded its not taking the value of the parameter passed from the parent report.
Kindly help. Thanks.
I've set up a dummy report that does what you asked for and found that SSRS will just not work - not give an error at all - if you don't have it exactly right.
Here are the steps I followed to make it work.
Create the parameter on the parent report and ensure it is set and that you are setting it either at run time or via default.
Ensure that the parameter you want to SET exists in the child report and has NO default value (this may not be necessary, but will help with debugging if it goes wrong)
Make sure the child report parameter has the the available values for your drop down set and that the one you are passing is there
Set up the drill through using the action section of the properties and Go to report
Specify the drill through report
Choose the parameter from the Name drop down (the available parameters in the child report WILL be there) and set the Value to [#ParameterName]
Test
If you don't want a parameter on the parent report and just want to hard code the value you can skip step 1 and change step 6 to just use the value.
you need to set the default specific value to the parameter so it will not show you "Select Value" in dropdown list.
Once you send parameter from Parent report it will set the value.

SSRS: How to use same dimension & hierarchy for 2 parameters

So, I'm stuck on how to resolve this issue.
I would like to use the same Dimension & Hierarchy two times.
The dimension and Hierachy is already used one time to exclude a column value.
Now I would like to add a parameter to the same hierachy/dimension (with acfource the earlier rule applied)
And I can't get my head around to solve this.
If I'm understanding your issue correctly, then the solution is fairly simple. For each parameter that requires a dropdown list you need a different dataset in your report. For the first parameter (#p1), set available values and labels based on the result of a query.
In the dataset for the second parameter (#p2) which should have a filtered dropdown, have a second dataset that will be used to set the available values and labels of the second parameter. In this dataset, you want to reference the value of #p1 somewhere in your query. Upon opening, the report will generate the results of the first dataset to populate the first parameter's dropdown list. Once a value has been selected for #p1, the report will generate the second dataset to populate the options for the #p2 dropdown list. In this way, you can dynamically filter the options available to the dropdown list for the second parameter.

SSRS cascading parameters: child parameters' default 'All' value drops to blank after user changes parent parameter

I have a big bunch of cascading parameters in my rdl report with default value 'All' everywhere. But all children go blank after user changes some parent parameter, and then he has to choose 'All' value from drop-down list for each of child parameters manually. This is pretty annoying staff. How can I force report to fix default 'All' value for child parameters, despite of any changes to parent parameter?
I've found decision for my child parameter go-blank problem. In the Report Parameters dialog just print to the 'non-queried' field default value in quotes. For example, in case of olap data source: print
="[Calendar].[Quarter].&[All]"
instead of:
[Calendar].[Quarter].&[All]
After this Quarter child cascading parameter will not lose it's default value 'All' when user chooses another Year. Nuts!
There is nothing you can do by keeping the default value to "All". That is for only the first time the report is rendered. Once you change the parent parameter, the child value is refreshed and then it starts looking towards "Available values" set.
So, whatever values are coming from the dataset which is the source of Available Values, will be considered to populate the child parameter then. So only way you can still have an "All" still, is to modify the dataset. We could probably help you further if you could share the MDX queries for the parameters, or even you could give it as shot.

Using column from main dataset as multi-value parameter in subreport

Hi I am using SSRS 2008.
My set up is MainReport with dataset1 and 1 parameter - OrderID. One of the columns in dataset1 is ShippingID.
My other report called - SubReport has 1 multivalue paramter - ShippingID.
I am trying to use ShippingID from Main report as multi-value parameter for Subreport.
I tried different threads here but mostly they are diffrent than my scenario.
How do I go about setting this up, is that even possible?
I have been trying to set it up for whole day but unsuccessfully.
In my scenario one Order can be on multiple shipments.
One of the things I tried is creating new multi-value parameter in MainReport - call it shippingIDs_sub and mapping its default value to dataset1.ShippingID. But when I try to run report I get error "The 'shippingIDs_sub' parameter is missing value" - because my MainReport would sometimes return NULL in ShippingID column.
My scenario is very much similar to this
SSRS passing parameter to subreport
although I sometimes get NULLs in the column used as source for multi-value parameter.
Is there any way to filter out NULLs and run subreport only for existing IDs?
In the Action where you call the sub-report, where you map to shippingIDs_sub, use an expression to pass some valid value whenever the value in your dataset is NULL.
=IIF(IsNothing(Fields!ShippingID.value),"Some Valid Value",Fields!ShippingID.value)
As to this:
Is there any way to filter out NULLs and run subreport only for
existing IDs?
No, you can't turn off the ability to go to a subreport, but you can "hide" it by changing the appearance of whatever your user clicks on so that it doesn't look like it's clickable. For example, in our reports, when something is clickable, we make it underlined in blue. So if I don't want to user to click it, I just make it the same font color/style as all the other text. But it doesn't stop a determined user from clicking on it anyway if they want.