aspose file tools*
The moose likes JDBC and the fly likes Jasper iReport is giving the wrong sum. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Jasper iReport is giving the wrong sum." Watch "Jasper iReport is giving the wrong sum." New topic
Author

Jasper iReport is giving the wrong sum.

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 580
I don't know why when I sum up the NetSales to a variable, set it as a type of bigdecimal, the field will give it a wrong sum
Anyone shed some lights on this, it would be greatly appreciated!



[Thumbnail for wrong sum 1.png]

[Thumbnail for wrong sum 2.png]

Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 131

probably you don't get the sum correctly.

Here is the way.

1. create a variable named total in Variables section in report inspector(in iReport designer).
2. select it and get it's properties.
3. select java.lang.Double as variable class
4. select sum as variable calculation
5. select field you want to get sum as Variable expression
6. drag and drop this variable to your report.

Hope this works.


Are you better than me? Then please show me my mistakes..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jasper iReport is giving the wrong sum.
 
Similar Threads
The BarTenders Kids
what's wrong with this code..coz when I compile it I get some starnge results
reference ... is ambiguous. How to handle it?
Query gives the wrong data
Trouble running simple sum-up program.