jgamble Posted September 22, 2006 Share Posted September 22, 2006 I am reading in an SQL query from a jdbc connection. I need to sum integers in a field column for a subtotal, but there are a couple of rows that I need to exclude from the summation. These rows can be identified by their integer values. I haven't been able to figure out how to do it. Is it possible? Any suggestions would be appreciated. I am new to Jasper and iReport.Post edited by: jgamble, at: 2006/09/22 18:54 Link to comment Share on other sites More sharing options...
lucianc Posted September 22, 2006 Share Posted September 22, 2006 You could doCode:<variable name="sum" class="java.lang.Integer" calculation="Sum"> <variableExpression>..condition.. ? $F{field} : new Integer(0)</variableExpression></variable> You can also use null instead of new Integer(0). HTH,Lucian Link to comment Share on other sites More sharing options...
jgamble Posted September 23, 2006 Author Share Posted September 23, 2006 Thank you. That did the trick!:) 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