AsyNew Posted August 24, 2007 Share Posted August 24, 2007 Hi, I'am using the ireport 0.5.3.I want create report that contains a piechart: that is the problem and i don't know why noone never had the same problem.So to create a pie chart we need to have "a key expression" (like $F{name}) "a value expression" like (like ${number}). According to each name we have a number.But in my case , i need to represent for exemple for the same 'name' the value of 'number1' and value of 'number2' in a piechart, i really don't how to do.I hope you will help, you are my last chance, please help!!! Link to comment Share on other sites More sharing options...
nittu02 Posted August 24, 2007 Share Posted August 24, 2007 It depends upon on what basis you are taking the number 1 and number 2 values right?? you need to put that expression in the key expression there. Or, if you are saying you need to put the same expression and different values, in the query, put the static value for the field you are selecting. Link to comment Share on other sites More sharing options...
nittu02 Posted August 24, 2007 Share Posted August 24, 2007 It depends upon on what basis you are taking the number 1 and number 2 values right?? you need to put that expression in the key expression there. Or, if you are saying you need to put the same expression and different values, in the query, put the static value for the field you are selecting. Link to comment Share on other sites More sharing options...
AsyNew Posted August 24, 2007 Author Share Posted August 24, 2007 Well, actually i need two key expression ans two value expression , something like series in the bar chart.To be more clear, i will show my real sql query: select sum(HN),sum(HS) from table where number="XX"HN :(official hour)HS : (non official hour) So in my pie chart i need to represent the value of both sum(HN),sum(HS) . Link to comment Share on other sites More sharing options...
AsyNew Posted August 28, 2007 Author Share Posted August 28, 2007 No one has an idea??!! Link to comment Share on other sites More sharing options...
dpinfo Posted August 29, 2007 Share Posted August 29, 2007 Your query is : select sum(HN),sum(HS) from table where number="XX" you need to create a new query like this select TYPE_HOURS,TIME from(select 'OFFICIAL HOUR' AS TYPE_HOURS,SUM(HN) TIME FROM TABLEGROUP BY 'OFFICIAL HOUR'UNIONSELECT 'REAL HOUR' AS TYPE_HOURS,SUM(HS) TIMEFROM TABLEGROUP BY 'REAL HOUR') The query will show : Official Hours and the total timeReal Hours and he the total time Then you can make a pie chart which will show for the type of hours the value of each one. I hope that this help. Bye Link to comment Share on other sites More sharing options...
AsyNew Posted August 30, 2007 Author Share Posted August 30, 2007 It's really fantastic!!!! Your solution is absolutly great!Thank you very very much for your help.I'am sure that you will help many other people in this forum.:P 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