If a value is null I want my text to display 'N/A'

Stimulsoft Reports.JS discussion
Post Reply
crushin
Posts: 6
Joined: Wed Jul 15, 2020 7:18 pm

If a value is null I want my text to display 'N/A'

Post by crushin »

I have a text field that receives a numeric value. I have a conditional set on the field to display the value in different colors depending on the number. If it is returned as Null, I'd like to be able to display 'N/A.' I thought this would be as simple as setting a conditional where if the value is null to assign the expression 'N/A'. With this condition in place it still displays a 0. How can I fix this?
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: If a value is null I want my text to display 'N/A'

Post by Lech Kulikowski »

Hello,

You can use the following expression:
{IIF(source.column == null, "N/A", source.column)}

Also, you should set the ConvertNulls property for the report to false.

Thank you.
Attachments
Annotation 2020-09-10 103653.png
Annotation 2020-09-10 103653.png (16.81 KiB) Viewed 3506 times
crushin
Posts: 6
Joined: Wed Jul 15, 2020 7:18 pm

Re: If a value is null I want my text to display 'N/A'

Post by crushin »

This did not work. null is still being converted to 0. if I put {IIF(null == null, "N/A", source.column)} it works. It doesn't seem to be interpreting null correctly.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: If a value is null I want my text to display 'N/A'

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
Post Reply