When using the ReportingEngine with JsonDataSource I get an error on cm.PaymentSchedule.ReservationMoment. The error is:
“An error has been encountered while evaluating the expression or statement ‘cm.paymentSchedule.reservationMoment]>’. Object reference not set to an instance of an object.”
The template in my previous reply relates to your original query, it prints ReservationMoment when PaymentSchedule is not null. The template has nothing to do with an if tag.
If your scenario requires using of an if tag exclusively, then you can use the following syntax instead:
First the paymentschedule is not a collection so count won’t work.
Second, this is not the solution to my problem. How can I fix the template so it does not give the error on the second commitment where scheduledpayment is null?
I have checked this template using your data and was able to get expected results: It prints “Null” when PaymentSchedule is null (in JSON) and prints “Not null” otherwise. The reason why comparison with null does not work in this case and why you should use Count() instead is explained in this reply. Please check the template at your end and let us know if it does not work for you.
Thanx, it works now.
I find it quite unusual, that I can’t apply the null equation and that I must use the Count.
I think this should be a topic in your documentation when using json as datasource.