Jump to content
We've recently updated our Privacy Statement, available here ×

sct999.1

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by sct999.1

  1. I already implemented the chart customizer suggested in this question: http://community.jaspersoft.com/questions/539659/how-show-percentage-decimal-value-pie-chart

    I adapted it to use a normal pie chart:
     

    import net.sf.jasperreports.engine.JRChart;import net.sf.jasperreports.engine.JRChartCustomizer;import org.jfree.chart.JFreeChart;import org.jfree.chart.labels.StandardPieSectionLabelGenerator;import org.jfree.chart.plot.PiePlot;public class PiePercentageCustomizer implements JRChartCustomizer{    @Override    public void customize(JFreeChart jFreeChart, JRChart jrChart) {        PiePlot piePlot = (PiePlot) jFreeChart.getPlot();        ((StandardPieSectionLabelGenerator)piePlot.getLabelGenerator()).getPercentFormat().setMaximumFractionDigits(2);    }    }[/code]

    I generate a jar file and added it to my application classpath.

    The problem is when I render my report I get the following exception:
     

    Class
    java.lang.ClassCastException
    Message
    net.sf.jasperreports.charts.util.PieLabelGenerator cannot be cast to org.jfree.chart.labels.StandardPieSectionLabelGenerator

    My application is a grails 2.3.11 project using the jasper plugin 1.11.0

    Any help will be appreciated
  2. Facing the same error too.
    The error is raised only when I deploy the report into a grails application running on tomcat server, in development environment works fine.

×
×
  • Create New...