remingtont
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forum
Events
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Downloads
Posts posted by remingtont
-
-
Hello,
I'm trying to create a complex expression that uses a comparison operator, however Jasper throws errors when it trys to compile my report.
$F{BUDGET_AMOUNT}).intValue()==0? 0:new Double($F{BUDGET_SPENT_AMOUNT}.doubleValue() / $F{BUDGET_AMOUNT}.doubleValue())
The BUDGET_AMOUNT coming from my db is a double, however I need to convert it to an int for the comparison, I assume I also need to convert a part of this to a boolean but I'm not quite sure how to do that.
Any help is appreciated.
Complex Expressions
in Products
Posted
Sorry yes the unopened bracket was a typo on my part when I cut and pasted.
I modified the expression which is now, in iReport when I validate the expression there are no issues.
$F{BUDGET_AMOUNT}==0.00? new Double(0):new Double($F{BUDGET_SPENT_AMOUNT}.doubleValue() / $F{BUDGET_AMOUNT}.doubleValue())
I get the following two errors repeatedly when attempting to compile.
')' expected - this is expected just before the ending semi colon on the following line.
value = (java.lang.Double)(((java.lang.Double)field_BUDGET_AMOUNT.getValue())==0.00? new Double(0):new Double(((java.lang.Double)field_BUDGET_SPENT_AMOUNT.getValue()).doubleValue());
';' expected - this is expected at the third closing bracket just before the semi colon.
value = (java.lang.Double)(((java.lang.Double)field_BUDGET_AMOUNT.getValue()).doubleValue()));