0

I want to concatenate 2 twooptionset values from MS CRM on true condition seperated by commas on a textbox and leave a blank if 2 twooptionset values are false.

I have writen an Expression in SSRS:

=iif(Len(Cstr(iif(Fields!aaValue.Value="True","aa,","") & iif(Fields!bbValue.Value="True","bb,","")))=0,"",
 Left((iif(Fields!aaValue.Value="True","aa,","") & iif(Fields!bbValue.Value="True","bb,","")),
 len(iif(Fields!aaValue.Value="True","aa,","") & iif(Fields!bbValue.Value="True","bb,","")) - 1
)

If either of 2 twooptionset values are true then it shows a text on textbox. If Both twooptionset values are false then it shows #error on the textbox.

So how to check null string in SSRS?

Prasanth
  • 3
  • 5
  • IsNothing Didn't worked for me i tried earlier. If X = iif(Fields!aaValue.Value="True","aa,","") & iif(Fields!bbValue.Value="True","bb,","") Is there any difference between =IIF(len(x)=0,"",Left((x),iif(len(x)=0,0,len(x) - 1))) and =IIF(len(x)=0,"",Left((x),len(x) - 1)) Because =IIF(len(x)=0,"",Left((x),iif(len(x)=0,0,len(x) - 1))) worked for me and =IIF(len(x)=0,"",Left((x),len(x) - 1)) Didn't Worked for me – Prasanth Apr 28 '16 at 14:25

1 Answers1

1

You can use the IsNothing function. Remember, in SSRS these expressions are actually writte in the Visual Basic language.

However, the IsNothing function is not necessary at all. Just use the CBool conversion function. It can handle Nothing (null) values:

= (Iif(CBool(Fields!aaValue.Value), "aa,", "")
    & Iif(CBool(Fields!bbValue.Value), "bb,", "")).TrimEnd(",")
Henk van Boeijen
  • 7,357
  • 6
  • 32
  • 42
  • IsNothing Didn't worked for me i tried earlier. If X = iif(Fields!aaValue.Value="True","aa,","") & iif(Fields!bbValue.Value="True","bb,","") Is there any difference between =IIF(len(x)=0,"",Left((x),iif(len(x)=0,0,len(x) - 1))) and =IIF(len(x)=0,"",Left((x),len(x) - 1)) Because =IIF(len(x)=0,"",Left((x),iif(len(x)=0,0,len(x) - 1))) worked for me and =IIF(len(x)=0,"",Left((x),len(x) - 1)) Didn't Worked for me – Prasanth Apr 28 '16 at 13:03