I am using Jasper Report generation in my application (Java application with JSP). I have a JSP page with a table, and I was able to successfully generate the .xslx file with this data through jasper reports.
I used below lines in code,
dataList is an ArrayList of Beans one row in the table - information of one person. Thus, we can create a Bean for this, and all the row data will be ArrayList of Person Beans ie ArrayList<Person> personalData = new ArrayList<Person>();
JRBeanCollectionDataSource beanColDataSource = new JRBeanCollectionDataSource(this.dataList); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, beanColDataSource);
So, when it is one table, straight ahead. What about multiple tables and I want to create a report for printing?
As in the image, these tables are completely independent of each other.
so now i have some ArrayLists (data sources)
ArrayList<Person> personalData = new ArrayList<Person>(); ArrayList<Vehicle> vehicleData = new ArrayList<Vehicle>(); ArrayList<Problem> problemData = new ArrayList<Problem>();
But I can use only one JRBeanCollectionDataSource , as in the code below
JRBeanCollectionDataSource beanColDataSource = new JRBeanCollectionDataSource(this.dataList); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, beanColDataSource);
So, how can I successfully make a report with all the data tables that I have?

java jsp jasper-reports
prime
source share