About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).

Monday, December 08, 2008

Displaying a list of user selected parameters in Reporting Services

I’m generating a notice that the user will need to select reasons for an application was rejected. The user could select multiple reasons, but must include at least one. So I needed to display the reasons of rejection in the report like:

* Reason1

* Reason2

*Reason4

The problem I was running into was checking how many reasons were selected and displaying only the selected amount. I was at first trying something like this for all counts of Parameters!Reasons:

=IIF(Parameters!Reasons.Count < 2, “”, “* “+Parameters!Reasons.Value(1))

The problem with this is, even though the count was less than 2 the false part of the IIF still gets evaluated, giving me an “#Error” in my document with an index out of bounds.

I then got cleaver and tried using the join and came up with this:

="* " + Join(Parameters!Reasons.Value,VbCrLf+VbCrLf + "* ")

While, normally a join would use something like a whitespace or comma to delimit.

No comments: