hgfree Posted August 5, 2009 Share Posted August 5, 2009 Hello!Can anyone help me with dividing two variable Totals?I have two variable Totals. Each Total is the sum of a field in the detail band. The Totals appear in a group footer. I would like to divide SUM_Field1 by SUM_Field2. Any help would be greatly appreciated. iReport 3.0.0 pro.Thank You,Chris Link to comment Share on other sites More sharing options...
kchaudhry Posted August 5, 2009 Share Posted August 5, 2009 Create a new textfield with a class type Double then add the following in your texfield expression:new Double($V{SUM_Field2}.doubleValue() == 0 ? 0 :($V{SUM_Field1}.doubleValue()/$V{SUM_Field2}.doubleValue()))Hope this helps! Link to comment Share on other sites More sharing options...
hgfree Posted August 5, 2009 Author Share Posted August 5, 2009 You are fantastic! Thank you so much!Chris 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