You are relying on the IIf
expression short circuiting, but SSRS IIf
expressions do not short circuit - the expression will try and work out Split(Fields!WIAPPORVER.Value,"#")(1).ToString()
for all rows and fail when this value doesn't exist.
You can get this going by using text expressions, which don't get this error.
With test data:
And a simple table:
I have added columns with both your existing expression and a new expression:
=Right(Fields!WIAPPORVER.Value, Len(Fields!WIAPPORVER.Value) - InStr(Fields!WIAPPORVER.Value, "#"))
This new expression works for NULL values, empty strings and strings with no delimiter present: