Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

parameters list: Allow multiple values not working Expand / Collapse
Author
Message
Posted Friday, August 8, 2014 9:24 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 9:00 PM
Points: 680, Visits: 1,598
I have a parameters (drop down list) containing all text values that I built by manually providing the values in Add Values (as opposed to from query). It contains about 10 values (Division).

It works. This drop down works fine by listing all available values and allows you to select one and returns correct results. But, I also need a default Select All option, so that users can select more than one value at a time or all values, and that's where the problem begins.

--->

To activate the 'Select All' option I went to the parameter's General tab, checked 'Allow multiple values'

After I do that, I can still bring up the Preview page, and then see the drop down list has the (Select All) check box. I can also see the checkbox next to each one of the Division values. However, when I click Select All or any one of the values independently or together I get 'Loading....' followed by error

"An error has occurred during report processing. The processing of FilterExpression for the dataset 'PPCQuery' cannot be performed. Cannot compare data of types System.String and System.Object[]. Please check the data type returned by the FilterExpression."


Can you tell me how to solve?
Post #1601231
Posted Friday, August 8, 2014 10:20 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:01 AM
Points: 10,282, Visits: 13,266
It sounds like you have cascading parameters and PPCQuery is a dataset that populates a parameter that is dependent on the value(s) in you are selecting in the Division parameter. You need to re-code the filter expression PPCQuery to handle a multi-select parameter. I'm guessing the expression is something like this:

=Parameter!Division.Value



and you need to account for the fact that the multi-select parameter's value is now an array so you need something like:

=Parameter!Division.Value(1)

I haven't worked with this is awhile but if you Bing\Google working with SSRS multvalue parameters you should find what you need to make it work.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1601262
Posted Friday, August 8, 2014 10:58 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 9:00 PM
Points: 680, Visits: 1,598
i have only one drop down box.
Post #1601276
Posted Friday, August 8, 2014 11:03 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 9:00 PM
Points: 680, Visits: 1,598
actually, it's really weird it's using PPCQuery, because I supplied the values for the drop down by typing them in. The parameter values are not supplied by a query!
The datatype for the Division values in the PPCQuery is nvarchar(255) and the datatype specified for this parameter is text. These should be compatible.
Post #1601278
Posted Saturday, August 9, 2014 7:49 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 9:00 PM
Points: 680, Visits: 1,598
For others who may encounter this perplexing situation (which is unique because the drop down is NOT based on a query and neither does the main report query contain a WHERE clause),
the solution is quite simple.

Because you are selecting an array of values (in my case Divisions) from the drop down, SSRS assigns the system.Object type to the list of values.

Now EVEN THOUGH you are not using a WHERE filter in the main report query, and there is really no place to put 'IN'....you must still apply the concept of IN to the dataset filters. For me this is not as intuitive as using slicers in Excel.

This link http://www.mssqltips.com/sqlservertip/2866/sql-server-reporting-services-using-multivalue-parameters/ and in particular the section Using Filters with Multiple Value Parameters shows how to select IN in the Tablix properties dataset filters. '

You must right click on the dataset to get to the Tablix properties. So, just by changing from '=' to 'IN' I was able to make the Select All work.

Post #1601542
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse