SSRS Multi-Value Parameter Not Filtering

2.7k views Asked by At

I have a few Parameters that I am trying to set based off of results that the user selects, but when I select from my Multi-Value Parameter my report errors with Failed to evaluate the FilterValues of the DataSet 'DST_MyThirdDataSet'

I have my first DataSet called DST_MyFirstDataSet which is used to create a list Parameter called Parameter1.

My second DataSet called DST_MySecondDataSet is filtered based from what is selected in Parameter1. My filter looks like this:

Expression [DataSet1Id] Integer = CInt(Parameters!Parameter1.Value)

This is what I use for my second Parameter called Parameter2 which is a Multi-Value parameter. This seems to be working correctly.

My third DataSet is called DST_MyThirdDataSet which I have set up to be filtered based off of what is selected in Parameter2. My filter looks like this:

Expression [DataSet2Id] Integer In CInt(Parameters!Parameter2.Value)

Everywhere I have looked online seems to support what I have (using the In Operator and using Parameters!Parameter2.Value), but i still seem to be getting this silly error.

Does anyone see where I could be going wrong here?

EDIT

It seems to work if instead of converting the Parameter to a Integer, I convert the Field to a String, but why cant I do it the way that I originally had?

1

There are 1 answers

2
Mike D. On BEST ANSWER

It doesn't work because Parameters!Parameter2.Value is actually an array because it is a multi-select parameter. So you're trying to convert an array to an integer and that won't work.

You can even access individual array elements by doing Parameters!Parameter2.Value(1) or the number of items in the array Parameters!Parameter2.Count (more info)

I would recommend setting the data types of your parameters to an integer if they are supposed to be an integer. That way you can avoid having to do any conversions that might fail. parameter data type configuration