1

i am using RDLC reports in asp.net c#, i am using expressions like IIF conditions etc, i have used this condition

=iif(Fields!TimeFrame.Value <= 24 AND Fields!TimeFrame.Value >=0 , "Yes", "No")

it works but i just want to handle one another condition what if value returned is =-1 then ?

i want to put condition like if Value= -1 then "Not Yet Received" but it doesn't work like the way i am thinking, help in putting condition,

how to put another if condition or any way ?

user3518032
  • 423
  • 8
  • 25

2 Answers2

2

You can try to nest two iifs expression for example (formatted for readability) :

=iif(
      Fields!TimeFrame.Value = -1
      , "Not Yet Received"
      , iif(Fields!TimeFrame.Value <= 24 AND Fields!TimeFrame.Value >=0 , "Yes", "No")
    )

Above expression means if value equals -1 then return "Not Yet Received", else check another if condition which return "yes" or "no".

har07
  • 88,338
  • 12
  • 84
  • 137
  • Doesn't work in what way? no error or any other kind of clue? Another possible option is using `switch` : http://stackoverflow.com/a/999882/2998271 – har07 Aug 30 '14 at 07:18
  • one question, why there is an outer iif which surrounds internal iff, shouldn't it be isolated iif then another iif etc ? – user3518032 Aug 30 '14 at 07:29
0

=IIF((Fields!Mrmb.Value>0 AND Fields!Cn.Value>0),Fields!Mrmb.Value,IIF((Fields!Cn.Value>0 AND Fields!BchrA.Value>0), Fields!Ovrtme.Value,Fields!Bns.Value))

you can check this.

Ravi Kant Singh
  • 175
  • 2
  • 17