anwarzamal2000 Posted December 19, 2015 Posted December 19, 2015 Hi everyone I am new with ireport-5.6.0 My Urgent Requirement is to calculate total Male and Female from my report. For Example Student_Name Gender John MaleRekha FemaleRavi Male output:Total Male=2Total Female=1 In my report i create Two Variable one for male and another for female and set variable class=java.lang.BooleanCalculation=CountReset Type=ColumnIncrement Type=ColumnVariable Expression=$V{male} and drag both variable in my report when i click on preview its display null value I am not using any sub report in my report but i add two parameter i want to display my value in my column footer(column footer band) I also test with my sql query select count(*) as total , sum( case when gender = 'male' then 1 else 0 end ) as male , sum( case when gender = 'female' then 1 else 0 end ) as female from testdb.studentwhere department='Computer Science ' when i test this query in my database(mysql) its worked perfectly but when i tryed this query in my ireport query box its display wrong value Thnaks in Advanced Anwar
sanbez Posted December 21, 2015 Posted December 21, 2015 Example for count Male.Define variable:Variable class = java.lang.IntegerCalculation = SumResetType = ReportIncrement type = NoneVariable expression = $F{gender}.equals("Male") ? 1 : 0
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