SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


parameters list: Allow multiple values not working


parameters list: Allow multiple values not working

Author
Message
KoldCoffee
KoldCoffee
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1527 Visits: 1905
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?
Jack Corbett
  Jack Corbett
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18474 Visits: 14896
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
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

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
KoldCoffee
KoldCoffee
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1527 Visits: 1905
i have only one drop down box.
KoldCoffee
KoldCoffee
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1527 Visits: 1905
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.
KoldCoffee
KoldCoffee
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1527 Visits: 1905
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.
philip.webb46
philip.webb46
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 9
I was using a dataset returning multiple value and on my report filter I had set the operator to IN and the value to: =Parameters!ReportParameter1.Value()

This worked for me
pietlinden
pietlinden
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4880 Visits: 13170
Did you notice this? This thread is kinda old...

Posted 3 years ago
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search