I\'m building a chart in iReports and when I compile in Eclipse I get the following error:
net.sf.jasperreports.engine.JRException: Errors were encountered whe
In the .jrxml the data source for the chart is defined as:
This come from the iReports 4.7.0 autofill when you select Use datasource expression under Connection/Datasource exp in the details pane, the default expression from iReports is:
new net.sf.jasperreports.engine.JREmptyDataSource(1)
But this expression is wrong because .data is missing. It should read:
new net.sf.jasperreports.engine.data.JREmptyDataSource(1)
and then I changed the JREmptyDataSource(1) to JRBeanCollectionDataSource($F{chartData}) of course
This fixes the compile time error and then I had to reorganize and redefine my Lists and POJO's so that I could easily access the data point pairs in my List of ChartData objects. Essentially this meant that instead of a single ChartData object with two lists of doubles (one for X-Axis and one for Y-Axis), I now have a list of ChartData objects, each with just one XY point. This seems to work well for now.