I added the following line in my SampleReport.java class:
this.setVariableValue("List", list);//list is ArrayList of values to be displayed.
and the following line to the SampleReport.jrxml file
<variable name="List" class="java.util.Collection" resetType="Report" calculation="System">
How can I iterate through this Arraylist to show the values in the report alongwith the 2 charts already being displayed.
I have no problems in iterating through the arraylist values using JRBeanCollectionDataSource.
JasperFillManager.fillReportToFile("C:\\reports\\SampleReport.jasper", "C:\\reports\\SampleReport.jrprint", null, new JRBeanCollectionDataSource(list));
But in that case I am not able to show the charts.
So I am using JREmptyDataSource.
JasperFillManager.fillReportToFile("C:\\reports\\SampleReport.jasper", "C:\\reports\\SampleReport.jrprint", null, new JREmptyDataSource());
Please help.