October 25, 2006 at 9:10 am
SSRS Version: 2005
I've created a report that has a simple function that cycles through a multi-value parameter list array and returns a string value of each list item that was selected seperated by a comma. I use this so I can display in a textbox which items were selected. The code works when you preview the report in the designer; however, once it's deployed onto the server, the textbox that calls the code displays: #Error. I've been researching this problem in other forums, but the only thing I've come across talks about security permission when running a custom assembly. I'm not using any custom assemblies. Can anyone help me out with this problem and let me know how to resolve this issue? Below is a copy of the code I'm using. When calling the code, I'm passing the report parameter object to the function, which looks like this:
=Code.ReturnListValues(Parameters!ListBox)
Function ReturnListValues(oList As Object) As String
'Declare variables
Dim a As Integer
Dim sReturn As String
'Initialize string
sReturn = ""
'Determine if oList is a multi-value listbox
If oList.IsMultiValue Then
'Cycle through the listbox's value array
For a = 0 To oList.Count - 1
'Append the value to the string
sReturn = sReturn & oList.Value(a).toString() & ", "
Next a
'Remove the last comma and extra space
sReturn = Left(sReturn, Len(sReturn) - 2)
Else
sReturn = oList.Value.toString()
End If
'Return the string value
ReturnListValues = sReturn
End Function
Thanks,
Micheal
October 26, 2006 at 3:54 pm
Never mind. Someone from another forum suggested that I use the JOIN function instead of my code and it works just like I want it to.
Micheal
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply