camnott Posted August 30, 2017 Share Posted August 30, 2017 I have a variable to sum ETC's.It pulls in etc's by resource by investment. When I try to run the preview, I get this error : Reason: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source Text $V{Week 1} Basically, my SQL is doing a sum on the timeslice for each resource/investment/role. This works flawlessly in SQL Server Management Studio, but when trying to sum in Jaspersoft, it does not group the investments.I tried creating the variables as such :Week 1java.math.BigDecimalSum$F{Week 1}0Group 1Group 1 Here is a copy of some of the code : <variable name="Week 1" class="java.math.BigDecimal" resetType="Group" resetGroup="Group1" incrementType="Group" incrementGroup="Group1" calculation="Sum"> <variableExpression><![CDATA[$F{Week 1}]]></variableExpression> <initialValueExpression><![CDATA[0]]></initialValueExpression> </variable> <textField> <reportElement x="671" y="1" width="48" height="21" uuid="adc5d99a-2d2a-4205-9a75-3c7d2042367e"/> <textFieldExpression><![CDATA[$V{Week 1}]]></textFieldExpression> </textField> Any Idea's? Link to comment Share on other sites More sharing options...
camnott Posted August 30, 2017 Author Share Posted August 30, 2017 So - Figured out the problem. The sum is coming back with "NULL"....... Had to remove initial value of 0.The probelm remains though, still no sum is happening Link to comment Share on other sites More sharing options...
mlopez_1 Posted September 1, 2017 Share Posted September 1, 2017 what type is $F{Week 1} ? Link to comment Share on other sites More sharing options...
camnott Posted September 5, 2017 Author Share Posted September 5, 2017 $F{Week 1} is BigDecimal 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