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

sql server reporting services : IsMultiValue / Join - Problem


Wayne Snyder
11/15/2005 8:59:05 AM
Shouldn't the last value be Parameters!Para1.Value instead of Para1.Value...


--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC

I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.


[quoted text, click to view]
Bruce L-C [MVP]
11/15/2005 11:06:14 AM
I think this would work:

=Assembly.Function( IIF(Parameters!Para1.Count > 1,
Join(Parameters!Para1.Value, ", ", Paramters!Para1.Value(0)) ) )


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Ralph Watermann
11/15/2005 11:28:44 AM
Hi,

we try to pass a parameter to a "universal" assembly function but do not
know in advance if the parameter is multivalue or not. So we tried the
following: (the function returns an MDX-query-String to retrieve the
dataset):

=Assembly.Function( IIF(Parameters!Para1.IsMultiValue,
Join(Parameters!Para1.Value, ", ", Para1.Value) ) )

If Para1 ist multivalue, everything works fine. But if not, we have to call
=Assembly.Function( Para1.Value )

or otherwise we get an error.

What do we wrong?

Bruce L-C [MVP]
11/22/2005 11:19:47 AM
Write code behind to do this for you. That is the general solution to deal
with both sides of an iif being evaluated (have same problem with divide by
0 type of problem).


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Ralph Watermann
11/22/2005 11:39:01 AM
I couldn't get your suggestion to work, so I tried:

=IIF(TypeOf Parameters!TestSingleOrMulti.Value IS ARRAY,
JOIN(Parameters!TestSingleOrMulti.Value, ", "),
Parameters!TestSingleOrMulti.Value)

But this fails, too.

To make it more clear: We have to decide at runtime, if a parameter is
multi-value or not. And not if there is only one entry in a multi-value
parameter! The IS ARRAY-statement ( or IS STRING) statement works correct,
but both parts of the above if-statement seem to be evaluated, and one if
them of course has to fail...

"Bruce L-C [MVP]" <bruce_lcNOSPAM@hotmail.com> schrieb im Newsbeitrag
news:e$K1jbg6FHA.3880@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

Bruce L-C [MVP]
11/23/2005 7:33:08 AM
You pass it Parameters!Para.Value and your code returns whatever is
appropriate. In code you can use if then logic and only the appropriate
logic will be executed.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Ralph Watermann
11/23/2005 11:29:14 AM
Hmm, I'm no expert in VB.NET, but my problem is that if I use code behind I
have to pass the value of EITHER Parameters!Para.Value OR
JOIN(Parameters!Para.Value,", ") to my code behind and decide this AT
RUNTIME (!)
And this seems to me the same problem. I'm not able to see the solution in
your suggestion.


"Bruce L-C [MVP]" <bruce_lcNOSPAM@hotmail.com> schrieb im Newsbeitrag
news:eLOrxj47FHA.3200@TK2MSFTNGP11.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button