Jump to content

How to Dispaly sum of one column based on other c


RAJIV

Recommended Posts

Hi EveryBody,

 

I am generating report(PDF format),..in that i am facing a problem. I want to display sum of one column values based on other column values repectively.

 

Example,

My report has 2 column like the follwing

Code SumInsured

KRW 1000.00

USD 200.00

KRW 2000.00

 

At the end of my last page i want display like this

 

Total Sum Insured in KRW is : 3000.00

Total Sum Insured in USD is : 200.00

Total Sum Insured in INR is : 0.00

 

 

How to do,...pls help me for this

 

I have been using iReports tool design my PDF page

 

 

 

Regards,

Rajiv

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

You can use variables to do this...You must be having 2 fields representing code and amount, I am assuming them as $F{CODE} and $F{AMOUNT}

 

You can define a variables $V{TOTALAMOUNT_KRW},$V{TOTALAMOUNT_USD} etc., with evaluation time as Report and calculation as "Sum"

 

Assign the expression: $F{CODE}.equals("KRW")?$F{AMOUNT}:0

 

You can replace KRW with different currencies for each variable and use the variables in your report to show the Amounts for each currencies......

 

All the Best!!!

 

Jagadeesh

Link to comment
Share on other sites

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...