partizan1 Posted June 10, 2010 Share Posted June 10, 2010 Hi,Has anyone else encountered the problem of not being able to use the Sum function on a Variable? I need to calculate the total number of a column value (i.e. AFFECTED_ROWS column in my table). I have the variable 'totalNumbAffected' which has the Properties set to:Variable Class: DoubleCalculation: SumReset type: ReportIncrement type: NoneVariable Expression: $F{AFFECTED_ROWS} If I print the variable on my report, it does display the correct sum. However, if I try using it in my Pie Chart, for each pie slice the value is different and therefore it's incorrect (except for the last pie slice). My question is - How can I calculate the Sum of my column before it's used in my pie chart so that the value is the same for all pie slices? Can someone help please? Thanks,partizan Link to comment Share on other sites More sharing options...
partizan1 Posted June 14, 2010 Author Share Posted June 14, 2010 I found out how to get the percentage. This forum helped me: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=49687Please refer to this quote by Teodor: "In JasperReports version 3.1.0, we have introduced two new properties to control the appearenace of section labels and legend labels. These two are called labelFormat and legendLabelFormat.You can use {0}, {1} and {2} for displaying the key, the value and the percentage in pie charts.For these formats to be used, you have to leave the labelExpression empty.I hope this helps." by Teodor I hope that helps to the rest of you having this problem. Cheers,partizan 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