francesco334 Posted September 21, 2006 Share Posted September 21, 2006 Hello All, I have the necessity,in iReport, to Sum much Variables or Fiels. It seems simple,with the Sum function of iReport,but my problemis this: 1)In the Details Band, I must Sum all the Amount (that can be stay in field BaseAmount or in field TaxAmount in case of Tax="True" or Tax="false") setting the value of the Amount field in a Variable "Total". 2) Then I'll show the value of Total, in the Summary band! How can I do??? I send you the jrxml and xml. Thanks for all your response! Francesco [file name=Fattura.zip size=9817]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Fattura.zip[/file] Link to comment Share on other sites More sharing options...
zannabianca Posted September 22, 2006 Share Posted September 22, 2006 I have your same problem. I've found this workaround. In the query I calculate a column TOTAL as sum of all the columns of my interest. Then in the detail I show the column TOTAL and in the summary the sum of the column TOTAL. Hope that this could help you.Byezannabianca Link to comment Share on other sites More sharing options...
zannabianca Posted September 26, 2006 Share Posted September 26, 2006 I've found the way with the search forum to make the sum with the variables. new Double( $V{var1}.doubleValue() + $V{var2}.doubleValue() ) It is supposed that the type is Double. If you change the + with another operator (e.g. -) you can make the others elementary operations. I Hope that this help Byezannabianca 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