Passing a multi-valued parameter to a subtitle

I have a problem when working with multivalue parameters between reports.

I have a main report in which I defined a multi-valued parameter that I use to run an SQL query to populate its dataset. The parameter is used in the WHERE clause as follows:

 WHERE values IN (@parameter) 

It works fine and returns the expected data.

This master report then passes this parameter to the subreport. A parameter is also defined as multi-valued in the subtitle, and, as far as I can see in the drop-down list of parameters, it gets the correct values. Something like this: A, B, C

The fact is that a query that populates a subreport dataset returns nothing. It also has a WHERE clause defined as in the main report (which already works)

 WHERE values IN (@parameter) 

If I run the query manually, copying the values โ€‹โ€‹something like this:

 WHERE values IN ('A', 'B', 'C') 

It works, but when I try to use a parameter, it is not. So, somehow, it will lose format or values โ€‹โ€‹in the path.

I tried this solution in defining a subreport dataset that was suggested in another thread:

  =join(Parameters!<your param name>.Value,",") 

But this does not work for me, the dataset is still empty.

Any ideas on what I am missing?

Thanks!:)

+4
source share
3 answers

Just created a report from scratch and it worked. I must have forgotten something in the middle.

In any case, in case someone needs it, two parameters, one from the main report and one in the subtitle, should be defined as multi-valued. Then in your query you should use IN in the WHERE cluster, something like this:

 WHERE field IN (@parameter) 

And nothing else is needed. I did not need to do the following:

 =join(Parameters!<your param name>.Value,",") 

It just worked for me

+3
source

It should just work. Make sure that the parameter in the sub file is configured as multi-valued, and I usually use the same query as in the parent report to provide "Available Values".

Make sure that you pass the entire parameter to the subregister: in the subtitle properties in the parent report, the parameter value should read [@MyParamName] not <<Expr>> . If it reads as the last, edit the expression and make sure it does not have (0) at the end. but =Parameters!MyParamName.Value correct, not =Parameters!MyParamName.Value(0)

+7
source

I think I know what you did, because they brought me here, having the same problem. Nested reports were configured normally, but when entering the parameter binding in the parent report, Value drop down did offer my parameter, so I used the expression constructor to select it. This left the gray << Expr >> sign in the value and will only work if I had only one value selected from the list. When I replaced this with [@MyParam] , it worked fine, regardless of the number of values โ€‹โ€‹selected. When I looked at the construction of the expression of values, the creator is a little closer, he had =Parameters!MyParam.Value(0) . Removing (0) also fixes it.

+1
source

All Articles