Conditional espression check on division by 0 produces error

Stimulsoft Reports.JS discussion
Post Reply
basespetley
Posts: 4
Joined: Tue Apr 02, 2019 5:35 pm

Conditional espression check on division by 0 produces error

Post 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
Lech Kulikowski
Posts: 6266
Joined: Tue Mar 20, 2018 5:34 am

Re: Conditional espression check on division by 0 produces error

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply