Jump to content
We've recently updated our Privacy Statement, available here ×

how to calculate Totalsum of percentage in ireport


anupp

Recommended Posts

Hi,

    I have done percentage in ireport  for each column.but i m facing problem is how to calculate sum of percentage in ireport.for example :

row1 -10%

row2-90%

sum of  Total percenatge is 100%.(i want to do that calculation only.)

 

Thanks

Anup

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello,

 

This is something I jotted down when I needed to do something similar to what you're doing. Perhaps this will help you find your answer as well:

 

 

Calculating a Percent Using a Report Total

 

-- First, define a variable that sums a field in your table. Set the "Reset Type" to REPORT and the "Increment Type" to NONE.

 

-- Now add a text field to the detail line to calculate the percentage. Set the "Evaluation Time" to AUTO. Create the expression, for example:

 

new java.math.BigDecimal($F{AP_PAYMENT_COUNT_TOT}.doubleValue() /

$V{ap_payment_count_rpt_tot}.doubleValue())

 

-- With the evaluation time set to auto, the field value is NOW and the variable value is REPORT to allow for the right calculation.

 

 

 

David

Link to comment
Share on other sites

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...