peanut69 Posted January 24, 2007 Share Posted January 24, 2007 Any help on this would be greatly appreciated: Have two exressions displaying on report, both setup identical. They are displaying differing results. Compared XML between them and have the following:-----------------------------------------------------<variable name="numerator" class="java.lang.Double" resetType="Group" resetGroup="By_EMP" calculation="Nothing"> <variableExpression><![CDATA[new Double( $V{By_EMP_REG_HRS}.doubleValue()==0 ? 0.00 : (($V{By_EMP_PAID_ABS_HRS}.doubleValue()-$V{By_EMP_STAT_HOL_HRS}.doubleValue()-$V{By_EMP_VAC_HRS}.doubleValue()) / $V{By_EMP_REG_HRS}.doubleValue())*100.00 )]]></variableExpression> </variable> -----------------------------------------------------<variable name="By_EMP_STD_ABS_PC" class="java.lang.Double" resetType="Group" resetGroup="By_EMP" calculation="Nothing"> <variableExpression><![CDATA[new Double( $V{By_EMP_REG_HRS}.doubleValue()==0 ? 0.00 : (($V{By_EMP_PAID_ABS_HRS}.doubleValue()-$V{By_EMP_STAT_HOL_HRS}.doubleValue()-$V{By_EMP_VAC_HRS}.doubleValue()) / $V{By_EMP_REG_HRS}.doubleValue())*100.00 )]]></variableExpression> </variable> ----------------------------------------------------- the second one is producing the word NULL or 100% whereas the first one produces the correct results. Any thoughts? Link to comment Share on other sites More sharing options...
peanut69 Posted February 10, 2007 Author Share Posted February 10, 2007 We discovered the solution to this problem. When declaring a variable that uses an expression. The variable needs to be defined lower on the list than all the operands used in the expression. This was our problem. 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