gregory.west Posted January 11, 2016 Share Posted January 11, 2016 Is this allowable in Jasper Studio:IF(($V{DID_BW}==0 && $V{DID_Colour}==0),0,($V{DID_Copy}/($V{DID_BW}+$V{DID_Colour})))This is the assignment for a variable that is being printer on a report. What I am trying to do is print 0.00 is DID_Colour and DID_BW are both zero, otherwise do the calculations. This is being done to prevent the divide by zero error from happening. Link to comment Share on other sites More sharing options...
Solution javier.ggi90 Posted January 11, 2016 Solution Share Posted January 11, 2016 Try something like this instead:$V{DID_BW}==0 && $V{DID_Colour}==0 ? 0 : $V{DID_Copy}/($V{DID_BW}+$V{DID_Colour}) ? = THEN: = ELSEFor future references, you can also nest them. Link to comment Share on other sites More sharing options...
gregory.west Posted January 11, 2016 Author Share Posted January 11, 2016 WOW the syntax of Jasper takes a little getting used to, but my oh my Jasper is 1,000 times more powerful than programs I have have to pay thousands of dollars for. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now