using a reportitem.parent in an IIF function

1 Answer 44 Views
Report Designer (standalone)
Joe
Top achievements
Rank 1
Joe asked on 18 Jun 2021, 10:16 PM

Here is my expression...

= IIF(ReportItem.Parent.DataObject.SoldtoAddress.CustKey = "ADEEL", "M3","") + Fields.RollID

As-is, the expression works. But, if the expression is false and I put anything in the empty quotes, the report won't run and gives the error, "Object reference not set to an instance of an object."

Am I doing something wrong? Thanks!

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 23 Jun 2021, 12:25 PM

Hello Joe,

I am sorry to hear about this unexpected behavior with the expression you are using. I tried to reproduce it on my end in the Standalone designer, by using columns of different type (string or integer) in all combinations. All of my tests produced expected result and I did not have any errors.

=IIF(ReportItem.Parent.DataObject.A="Apple","It was an apple", "5") + Fields.int

There might be something specific to the report or data, that I am missing, and I will be happy to investigate it further. Please prepare a sample report that reproduces the issue and attach it to this thread.

I am looking forward to hearing from you and continue this discussion.

Regards,
Plamen Mitrev
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
Report Designer (standalone)
Asked by
Joe
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
Share this question
or