我有以下自定义代码,它在输入字符串中找到给定的字符串并相应地返回字符串数组。
Public Function ConvertCode(ParamValues As String, findString As String) As String()
Dim SrcArray() As String
Dim FndArray() As String
Dim DstArray() As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
SrcArray = Split(ParamValues, ",")
FndArray = Split(FindString,",")
For k = LBound(FndArray) To UBound(FndArray)
For i = LBound(SrcArray) To UBound(SrcArray)
If (InStr(SrcArray(i), FndArray(k)) > 0) Then
DstArray(j) = SrcArray(i)
j = j + 1
End If
Next i
Next k
ConvertCode = DstArray
End Function
我正在使用SSRS表达式来获取此代码返回的值。
=Join(Code.ConvertCode(Join(Parameters!ProcessingStatus.Value,","),"reject,fail,Reject,Fail"),",")
如果ProcessingStatus中没有匹配的元素,它会正确返回并且只显示匹配的strng,然后它将返回为#Error。请帮帮我。