4

Please can you someone help me? My question is :

How to use properly OR in IIF statement in RDLC report?

Both Fields!A.Value and Fields!B.Value contains string or empty string.

This code works fine:

=Iif(Len(CStr(First(Fields!A.Value, "dsResult_dtRows")))=0, True, False)

This code doesnt work:

=Iif(Len(CStr(First(Fields!A.Value, "dsResult_dtRows")))=0 Or
 Len(CStr(First(Fields!B.Value, "dsResult_dtRows")))=0, True, False)

thanks a lot for ideas and answers -marek-

pnuts
  • 58,317
  • 11
  • 87
  • 139
marek
  • 43
  • 1
  • 1
  • 3

1 Answers1

10

you should be able to concatenate the field values and test for the empty string instead of testing each value individually.

try

IIF(Fields!A.Value & Fields!B.Value = '',true,false)

for either empty returning true, try:

IIF(Fields!A.Value ='' or Fields!B.Value = '',true,false)
Beth
  • 9,531
  • 1
  • 24
  • 43
  • Thank you for your answer. You are right,it works...but if only both Fields!A.Value and Fields!B.Value are empty strings. – marek Jan 24 '11 at 23:25
  • ...but I need to have the result=true if A or B is empty. Not A and B. Im trying to work it out,using your sugestion,but unfortunately im not succesful. – marek Jan 24 '11 at 23:30
  • oh, sorry. thought you wanted both empty. I'll edit my response – Beth Jan 25 '11 at 15:57