SSRS Manually select values passed to a multi-value subreport parameter - reporting-services

In SSRS, I have a summary report, and when I click on any figures, it drills through a subreport that generate a list of skus.
I have setup the cells in the summary report and selected all Parameter for the drill through report.
For a multi-value parameter in the subreport, I want to manually select 2 out of 3 available values.
In the textbox property, under Action and parameters, What is the expression to specify the values I want to pass to my subreport?

1,2 - If your parameter is a integer. Don't use the expression with an equals sign, just 1,2 in the parameter value.
If your parameter is a string, I believe you need to double the double quotes.
""1"",""2""
You could also use the SPLIT function to create a string array from the hard-coded values:
=Split("1,2", ",")

Neither formula worked, but at the end, I just modified the list of available value on the subreport and added another value. Then, in the dataset query, I adjusted the WHERE clause so that when the paramater has said value, the field IN ("1","2")

Related

Populate a parameter dropdown based off another parameter

I am trying to populate a dropdown based off another dropdown parameter. I have 5 parameters, but the first 3 populate the 4th in the report. So the 4th and 5th parameter are what the user uses to populate a report. So the 4th parameter (meetings) has a meetings dataset and the 5th parameter is meetingType with a dataset of meetingType. So when the user selects a meeting, then the meetingType gets populated by that selection. Currently both dropdowns produce all results, which I don't want. I just want all results for meetings and then the meetingType gets populated by meeting.
The table it produces once the report is ran doesn't use those properties and there isn't a place to query anything. I can only use available values from each dataset and not use available values based on the selection of the 4th parameter.
I'm not really clear. do you need a parameter or do you just want to have the meeting type available as a value in your report output?
Fairly straightforward. You have two datasets, one for each parameter. You need to filter the second dataset based on the first parameter.
For example, I often create reports that ask for a range of values, let's say programs. Once the user has entered the beginning value, the ending value must be greater than or equal to the beginning value. So, on the ending value dataset I create a filter. In this case, the filter says that the field code (which is my program) must be between the starting parameter and the maximum value allowed:
You can make your filter as complex as needed - referring to the other parameter with a formula
You can also do this via separate datasets for each parameter.
Lets say you have two parameters #param1 and #param2
you want the values on #param2 to change based on #param1 selection.
You will have your main dataset (main_dataset) with a where clause something like this
where sometable.somecolumn = #param1
and sometable.someothercolumn = #param2
Now you create a dataset (param1_dataset) for #param1 which brings back all the values you require for this parameter
Now create another dataset (param2_dataset) form #param2 and add a where clause to it which restricts the returned list.. something like this..
where sometable.somecolumn = #param1
Now on your report parameters.. set the Available Values for each parameter (report parameter properties) to "Get Values from a query" and select the appropriate dataset and the value field and label field (returned by the dataset) for each parameter.
Now when you run your report, your parameter selection 2 should change based on what you selected for parameter selection 1

Display passed parameter in subreport when no match exists

I have a report with one subreport. The subreport is passed a variable, #staffid, to match against a table of employees. If there is no matching staffid, I need the parameter value (#staffid) to display in the subreport. I need to check to see if DisplayName exists for the subreport, and if not, show #staffid in textbox that would ordinarily show DisplayName if there were a match.
Below is a screenshot of the report output right now, but I need to fill in the empty user space with the value passed from the main report if there is no match.
I'm looking for an expression to use in the textbox that basically says, =IIF(ISNULL(Field.DisplayName.Value)),#staffid,Field.DisplayName.Value), but I can't find a combination that works.
Please pass "Parameteres!staffid.value" instead of "#staffid" in sub-report expression as #staffid is a parameter defined in sub-report

Multiple values to pass in a subreport SSRS

Can I use the below expression to pass multiple value in a parameter in subreport?
=Join(LookupSet(1,1,Fields!Name.Value, "DatasetName")," / ")
Will the Join and LookupSet function work in prameter value expression?
No your expression won't work. The Available Values for the Parameter are expecting a single record at a time.
I would create a parameter in the main report with the dataset as DatasetName with the Value of Name. You can set that to Hidden and don't need to use it.
Use that parameter to link to your sub report's parameter.
That should have the same functionality as what you want and would be faster that using the JOIN/LOOKUPSET.
As long as the receiving parameter in the subreport is set to "allow multiple values", you should be able to pass in the lookupset array itself without needing the JOIN function at all.

SSRS Drillthrough report - parameter passing

I have one report with columnName called as 'referenceName'. Two rows get displayed on this report with two different values for 'referenceName' column.
When I am click on the first/second value in the 'referenceName' column only first value gets passed to the next drill through report. Why?
Reason for this error was that I was passing the value of the parameter instead of name of the parameter. so, I was passing '#ReferenceName' instead of [ReferenceName].

SSRS multivalue parameter passing

I have a multi value parameter I get from a query. I pass it to my dataset and it works like a champ. The dataset parameter uses join, i.e., =JOIN(Parameters!CodeList.Value,",").
So far so good. However when I pass this to a subreport, the subreport seems to only "get" the first item in the list instead of the string.
Also, if I put a textbox on my main report that looks at the CodeList parameter, i.e., =Parameters!CodeList.Value(0), I just see the first item. Using JOIN here returns an error.
I clearly don't get something here. Any available illumination?:)
How about this ?
=Parameters!CodeList.Value(0) gives you the first selected parameter value
=Parameters!CodeList.Value(1) gives you the second selected parameter value
so on
&
Join(Parameters!CodeList.Value,",")
will give you the all selected value for the parameter seperated by ,
Condition is, parameter should exists lol'z.
Assuming that you want it to behave identically to your dataset in this report (I.E. you want to send a string containing all the values in your parameter separated by a comma), you just need to pass the same thing to the SubReport's parameter:
=JOIN(Parameters!CodeList.Value,",")
If what you actually want is for the Parameter in your SubReport to have the same values as the Parameter in your main report, you need to pass:
=Parameters!CodeList.Value
Note the absence of the (0) at the end. The (0) on the end of it will cause it to pass only the first value in the parameter which isn't what you're after.