Multiple values to pass in a subreport SSRS - reporting-services

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.

Related

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

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")

SSRS - use case of JOIN, SPLIT, combination of both

In SSRS, I am trying to understand the use case of Join and Split.
Lets say we have a multi-value Parameter on the SSRS report.
Assume we also have an embedded SQL or SP that accepts the above parameter (multi-value parameter #ParamName):
SELECT id,name
FROM someTableValuedFunction(#ParamName,',')
In order to be able to pass in the parameter value we should use the foll. expr at the dataset param:
=Join(Parameters!ParamName.Value,",")
This is because the SQL code accepts a single value parameter and Join does exactly that. And similarly the above Join can also be used to display the param value on the report if required.
Or is the JOIN function only needed if we want to display the parameter value on the report? In normal SQL/SP param it sufficient to use Parameters!ParamName.Value ?
Also, when do we use the SPLIT function? Example:
=Split(Parameters!ParamName.Value,",")
Is it that - when the SQL code requires that the parameter value be in form of a table - for example when the SQL is:
WHERE ColumnName IN (#Param)
What about the use case of:
=Split(Join(Parameters!ParamName.Value,","))

Issues with Passing Multi-value Parameters to a Drill through Report

I have two reports were I pass multi-valued parameters to it's underlining data and both reports work very well independently. The parameter strings are being split using the function dbo.UTILfn_Split. When trying to drill from the main or Summary report into the sub or Detailed report all other parameters field in the report are populated except the multivalued parameter field. The parameter lists or value are listed in the detailed report but not selected and therefore cannot run the report even though the detailed report parameter property is set to allow multiple values. In both reports, the where clause is set "IN" not "=." How do I fix this?
In your Summary Report, when you pass the parameter to the sub or detailled report, the passed value parameter should be like this expression:
=join(parameters!yourMultivaluedParameter.Value,",")
after that, you pass the name of the parameter to the corresponding parameter in the dataset Detailled report.
In your SQL (SP), get the multivalues of the parameter by spliting it with your function
like following, depending of the result of your function, for exemple:
INNER JOIN dbo.SplitFunction( #yourMultivaluedParameter,',') tmp on tmp.yourColumn = ...etc...
Hope it helps...

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.

Passing values for multi-value parameter in SSRS query string

I have two reports built using SSRS 2005. The first report is set to navigate to the second when a specific field is clicked.
There is a multi-value parameter on the second report. I need to pass multiple values for this parameter in the "Jump to Report" string when calling this report. Is there a way to pass multiple values? I have tried Field.Value but that doesn't work for multivalue, it wants Field.Value(0). Or can you pass a parameter that will cause the Select All value to be selected?
I figured it out. Looks like one of the parameters being passed in was Field.Value(0) instead of Field.Value. That was messing things up.