Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jasper iReport is giving the wrong sum.

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!

wrong sum 1.png
[Thumbnail for wrong sum 1.png]
wrong sum 2.png
[Thumbnail for wrong sum 2.png]
 
Supun Lakshan Dissanayake
Ranch Hand
Posts: 135
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic