Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Hiding table

Author  Topic 

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2009-10-16 : 07:52:28
Hi,

Im trying to hide a table based on a parameter selection:

I go table options>visibility and select expression and enter the following:

iif(Parameters!freepaid.Value = "Free",false,true)

It doesnt seem to like this, says arguement matching parameter 'a' cannot convert from object() to 'String'

Any ideas?

Thanks

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-10-16 : 08:28:58
I assume FreePaid is "string" in Report Parameter definition?

I just took one of my tables and did same and other than a space after each comma, works fine. My drop down values are WESTERN, CENTRAL and EASTERN

=Iif(Parameters!Region.Value = "CENTRAL", True, False)


John
Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-10-16 : 08:36:29
By any chance is the parameter set up as Multi-Select? Trying to convert Array to a String??? (well at least that is what this person named GOOGLE keeps pointing to :-)

John
Go to Top of Page

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2009-10-19 : 11:25:43
Yea found out the issue was when you set the parameter as a multi select it changes the data type of the parameter.

Is there a way to parse/work around this, because the above works when its single select.

Thanks

quote:
Originally posted by JCirocco

By any chance is the parameter set up as Multi-Select? Trying to convert Array to a String??? (well at least that is what this person named GOOGLE keeps pointing to :-)

John

Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-10-19 : 11:50:23
You can reference each array element via
iif(Parameters!freepaid.Value(0) = "Free",
iif(Parameters!freepaid.Value(1) = "Free"

and so on. (0) refers to the first

John
Go to Top of Page

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2009-10-19 : 11:54:25
uhm how would I turn that into a syntax correct if statement (sorry maybe thick question)

=iif(Parameters!freepaid.Value(0) = "Free",
iif(Parameters!freepaid.Value(1) = "Free",
iif(Parameters!freepaid.Value(2) = "Free", False)))

quote:
Originally posted by JCirocco

You can reference each array element via
iif(Parameters!freepaid.Value(0) = "Free",
iif(Parameters!freepaid.Value(1) = "Free"

and so on. (0) refers to the first

John

Go to Top of Page

JCirocco
Constraint Violating Yak Guru

392 Posts

Posted - 2009-10-19 : 12:23:32
Piece of proverbial cake...
But first we need to know:
- How many elements will appear in you multi-select list? Is it constant or variable?
- When they select "Free" will it always be in the same position (in other words will it always be the first parameter listed and there for always be in position (0)?

I just figured out the InScope values for a Matrix report that has 7 Row Groups and 2 Column Groups. I need something easier to work on.



John
Go to Top of Page
   

- Advertisement -