This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to calculate total within the ireport parameter?

 
Tina Ma
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am building up the object which will be printed out using ireport. At present I am calculating the totals in my java code. Is it possible to pass over the calculation burden to ireport? Is it possible to put a parameter in the ireport which will command it to calculate the total and display that value based on the values in the column displayed so far?
 
bilal sidiqui
Author
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Tina,

I'm not sure exactly what you are doing, but it appears you need to do some calculations in your report. All calculations are generally part of the *report design procedure* and should not have anything to do with java code. JasperReports provides rich features to do everything from simple sum and average to complex mathematical calculations over whatever records you chose. And you can use all these features of JasperReports with iReport.

My JasperReports book demonstrates the whole *design procedure* of reports that require logical, mathematical, or statistical calculations. You may want to go through the sample chapter (titled "Using Mathematical and Logical Expressions") of the book that is available for free download:

http://www.packtpub.com/sites/default/files/downloads/0769os-chapter-9.zip

The chapter demonstrates and explains how to calculate the sum/average/maximum of a column or things like that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic