I am trying to create a report with two additional reports for new and used cars.
I have defined a bean vehicle according to the JavaBeans specification. I thought of using a parameter map to transfer this data to an additional report through the main report, as described in JRBeancollection Data Transfer to publish a report and report in reports . p>
The steps I have taken so far are as follows:
First step . Passing a collection as a parameter
Map<String, Object> jasperParameter = new HashMap<String, Object>(); jasperParameter.put("new_Vehicles", createNewVehicles());
The second step is to create a parameter, new_Vehicles in my main report and set it as a Collection of data type
Third step . Creating a data source expression for an additional report as net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{new_Vehicles})
The fourth step is to create a field (just for this, before I add more fields), vehicleId in an additional report.
Question / questions that I have and would appreciate any help:
a) When I compile, it gives an error message that the above data source could not be resolved for the type. What am I doing wrong?
Okay, so I think that maybe an exception was thrown by adding the βnewβ before the data expression, new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{new_Vehicles}) .
But now, if there are two new media that I add to the list, it prints on two pages, basically one page per item in the list. My column headers are in the column heading range, and my fields are in the detail range.
Any suggestions on how I can prevent him from putting each item in a list on another page?