Page 1 of 1

Conditional espression check on division by 0 produces error

Posted: Tue Apr 02, 2019 5:39 pm
by basespetley
Hello,

I've been struggling with this for about half a day now. I am trying to enter an expression into our report editor.

Code: Select all

{root.Total_Distance==0?
    "? Dist":
        (root.Total_Volume==0?
            "? Vol":
            (root.Total_Volume/root.Total_Distance).ToString())}
I have read other posts stating that IIF conditions evaluate all arguments, and that the solution was to use this conditional syntax, however doing so does not work. If I remove the "/root.Total_Distance" on the last line, everything is fine.

What is wrong with my code?

Cheers,

Stan

Re: Conditional espression check on division by 0 produces error

Posted: Wed Apr 03, 2019 7:07 pm
by Lech Kulikowski
Hello,

We couldn't reproduce the issue on our samples. Please send us a sample report for analysis.

Thank you.