Hello all,
Is there any way to return a multi-value parameter as a sum of the
values instead of a comma seperated string?
For example, I have a table where one of the values is a bitmasked
number, representing a combination of 4 possible options.
I have the Report Parameter setup with Non-queried values. Ex. Opt1 = 1, Opt2 = 2, Opt3 = 4, Opt4 = 8.
And in my query, the WHERE clause is setup like: WHERE @.param &
ColumnX != 0
But of course, if I select multiple values for Opt1 and Opt3, it
returns 1,4 instead of 5.
Any suggestions?
Thanks - JasonYour parameter can be mapped to an expression. Query parameter and Report
Parameters are two different things. RS automatically creates the report
parameter for you so it seems like they are the same thing.
To do this is a two step process:
1. In layout tab, Report Menu ->Report Parameters. Change the name of the
parameter so it does not equal the name in your query.
2. Dataset tab, click on the ..., parameters tab. In the right column click
on the mapping and change to an expression which brings up the expression
builder. Have the expression builder change this to the way you want. You
might need to create some code behind report to do this.
I suggest whipping together a little VB test app to work out the code to
convert a comma separated string into a bitmask.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Jason" <flajason@.gmail.com> wrote in message
news:1176830583.305883.64460@.n59g2000hsh.googlegroups.com...
> Hello all,
> Is there any way to return a multi-value parameter as a sum of the
> values instead of a comma seperated string?
> For example, I have a table where one of the values is a bitmasked
> number, representing a combination of 4 possible options.
> I have the Report Parameter setup with Non-queried values. Ex. Opt1 => 1, Opt2 = 2, Opt3 = 4, Opt4 = 8.
> And in my query, the WHERE clause is setup like: WHERE @.param &
> ColumnX != 0
> But of course, if I select multiple values for Opt1 and Opt3, it
> returns 1,4 instead of 5.
> Any suggestions?
> Thanks - Jason
>
No comments:
Post a Comment