marlin_snyder Posted April 11, 2013 Share Posted April 11, 2013 I have a Nested IF expression working in Crystal Reports: if {@%Effect} <= 0 then {@CoCalcPL}else if {@%Effect} < 80 then {@CoCalcPL} * (1 - ({@%Effect}/100))else if {@%Effect} < 120 then 0else if {@%Effect} > 120 then ({@CashGL} * 1.2) - ({@CoCalcPL} * -1)else 0I'm struggling getting it to work properly in iReport:$V{PctEffect} < 0.0 ? 0.0 : $V{PctEffect} < .8 ? $V{CoCalcPL}*(1.0-$V{PctEffect}) : $V{PctEffect} < 1.2 ? 0.0 : $V{PctEffect} > 1.2 ? ($V{CashGL}*1.2)-($V{CoCalcPL}*-1.0) : 0.0 If I remove any two of the nested expressions, it will work fine, but when I add back even one nested expression, I get a compile error before the report even begins to fill. I have looked at several examples of nested IF expressions online and tried all of the various recommendations for enclosing in parenthesis, and haven't found anything to work with more than two expressions.I'll post the xml below Link to comment Share on other sites More sharing options...
Ankur Gupta Posted April 17, 2013 Share Posted April 17, 2013 Hi,Probably using proper brackets for the expressions will work for you because not using brackets would cause ambiguity for the jasper engine to evaluate the expresion correctly.Please let me know if it works for you. Thanks,Ankur 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