Groups | Blog | Home
all groups > sql server reporting services > october 2005 >

sql server reporting services : Multi-Select Error, easy question


Shane Eckel
10/3/2005 7:05:02 PM
I am trying to show/hide a table based on a multi-select parameter in VS 2005
beta 2.

In the parameter I have the following:
Data Type: String
Multi-value - checked
Label: General Info
Value: GeneralInfo

In the properties for the report I have the following under Visibility:
=IIF(Parameters!DisplayInfo.Value = "GeneralInfo", False, True)

When I execute the report and choose the only parameter value I get the
following. (once I get this to work I will add additional parameters)


Error:
Processing Error
"The Hidden expression for the table 'Table_Header' contains an error:
Overload resolution failed because no Public '=' can be called with these
arguments:
Public Shared Operator =(a As String, b As String) As Boolen':
Argument matching parameter 'a' connot convert from 'Object()' to 'String'.

Thanks!!!

--
Robert Bruckner [MSFT]
10/3/2005 7:22:14 PM
Once you mark a parameter as "multi-value", the .Value property will return
an object[] with all selected values. If only one value is selected, it will
be an object array of length = 1. Object arrays cannot be directly compared
with Strings.

To access individual values of a multi value parameter you can use
expressions like this:
=Parameters!MVP1.IsMultiValue
boolean flag - tells if a parameter is defined as multi value
=Parameters!MVP1.Count
returns the number of values in the array
=Parameters!MVP1.Value(0)
returns the first selected value
=Join(Parameters!MVP1.Value)
creates a space separated list of values
=Join(Parameters!MVP1.Value, ", ")
creates a comma separated list of values
=Split("a b c", " ")
to create a multi value object array from a string (this can be used
e.g. for drillthrough parameters, subreports, or query parameters)

See also MSDN:
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctjoin.asp
* http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctsplit.asp

-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.



[quoted text, click to view]

Shane Eckel
10/3/2005 11:53:16 PM
Robert, thanks my man, thanks for taking the time to respond. I'll try this
out first thing tomorrow.


Thanks!

Shane
--
Thank You!


[quoted text, click to view]
Shane Eckel
10/5/2005 9:18:01 AM
Robert, thanks for your reply. Very valuable information for this report and
for my future reports.

You wrote, "Object arrays cannot be directly compared with strings." Do you
know how I could do this 'indirectly'?

Let's say the user selects 'GeneralInfo' and 'Contact Info' in the
multi-select. Do you know of a way to evaluate their selection so I can take
action on it? (such as visability)

Thanks again for your help.

Shane
--
Thank You!


[quoted text, click to view]
Shane Eckel
10/5/2005 12:59:01 PM
Hi Robert, don't worry about replying again. I think I figured it out. I
need to split it after I join it, right?
--
Thank You!


[quoted text, click to view]
Robert Bruckner [MSFT]
10/5/2005 1:09:20 PM
Yes. The Join() will create a string from a multi dimensional object array.
The Split() function is the inverse function; it splits the string into a
multi dimensional array.

-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

AddThis Social Bookmark Button