elmoualh Posted August 3, 2010 Share Posted August 3, 2010 Hello every one. I'm new to iReport. I am trying to generate a report that has this structure :The fields retreived from database : P_AMOUNT P_CURRENCYand basicaly, I am asked to sum the values within a criteria, Currency. I have USD, and EUR as currencies, and the AMOUNT is in one of the two currencies I mentioned.I created 2 variables in my Report called : USD_TOTAL and EUR_TOTAL, but I don't know how can I write an expression for those varaibles tocalculate the 2 sums. Can you please help me?It's really urgent.thx in advance Link to comment Share on other sites More sharing options...
nibedita Posted August 3, 2010 Share Posted August 3, 2010 u can use sql query for sum in your report query. Link to comment Share on other sites More sharing options...
elmoualh Posted August 3, 2010 Author Share Posted August 3, 2010 I have tried but It didn't work, and I tried to use multiple queries but it took only the first one :S Link to comment Share on other sites More sharing options...
jasperforum Posted August 6, 2010 Share Posted August 6, 2010 just create a variable and set the properties for caluculation --sumand for variable Exp--put the if conditionlet me know if it works Link to comment Share on other sites More sharing options...
elmoualh Posted August 7, 2010 Author Share Posted August 7, 2010 thx for your reply.I reanalized my SQL Query and managed to simulate the formula in SQL, and I imported the calculated values into my report, and it worked.Thank you again,Regards Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now