This is a migrated thread and some comments may be shown as answers.

Nested IIF not working

1 Answer 225 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Pinkesh
Top achievements
Rank 1
Pinkesh asked on 28 Nov 2016, 09:44 PM

Im trying to use nested if statement, but it fails to work:

 

inside my textbox:

=Max(IIF(Fields.RequestContactCodeDescription = "Broker", 
IIF(Fields.HomePhoneNo = "", IIF(Fields.BusinessPhoneNo = "", IIF(Fields.CellNo = "", "No Contact Num", Fields.CellNo), Fields.BusinessPhoneNo), Fields.HomePhoneNo), ""))

 

 

equivalent pseudo if statement:

If(Fields.RequestContactCodeDescription == "Broker"){

     if(Fields.HomePhoneNo == ""){

          if(Fields.CellNo == ""){

           [...]

          }else{

            //Show CellNo

          }

      }else{

         //Show HomePhoneNo

     } 

}else{

//show nothing

}

 

What I want it to do:

Find the entries that has 'Broker' as the code Description. Then show his Home phone number, if he doesnt have that then show his Cell number, if he doesnt have that then show his Business number

1 Answer, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 29 Nov 2016, 10:10 AM
Hello Pinkesh,

The expression works correctly in our test, please check the attached TRDP file in the Standalone Report Designer of Telerik Reporting R3 2016 or newer.

Double-check if the fields are of string type and if they come as empty strings (""), null or other that mey require comparing them to different values e.g. as condition Fields.CellNo Like '' or Fields.CellNo Is Null or IsNull(Fields.CellNo,'') Like ''.


Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Pinkesh
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or