1
Please inform if I need to improve the explanation.
I am trying to create a report in Jaspersoft Studio composed of three sections: customer information (a Javabean containing name, email, date of birth, etc.), customer’s addresses (a list of Javabeans each containing the name of the street, number, neighborhood, etc.) and customer requests (also a list of Javabeans, containing order number, date, simple address, total, etc.).
I understand that each of these sections would be a sub-report, powered by a separate Javabeans datasource.
I’m not sure how to distribute them in pages. For example, the first section (customer information) is small and could fit on a page along with the second section (customer’s addresses). But addresses can eventually take up more than one page, so maybe they should be placed on a separate page. I don’t have enough practice with Jasperreports to decide, and I also don’t know how to add two datasources to a single report/page, just an individual report. So I’m considering one sub-report per section.
Also not sure in which bands should I put the sections. I managed to put the first section in the band Title and the second in the band Summary, but I’m not sure where to put the third section. Put two sections in the same band (for example, in the Title) apparently makes one overlap with the other.
Any hint?
Hello, your text implies that it is possible to include more than one Detail band in the same master report, this is possible?
– Piovezan
Hello @Piovezan, yes it is perfectly possible, I even recommend using a band of Detail by subreport, it is more organized.
– nullptr
There is a detail related to Details, they are rendered depending on the amount of records passed in the datasource, if you treat multiple subreports as my suggestion, the master should understand that you should render only once, otherwise you will get thousands of equal Details :)
– nullptr
How the master is told to render once or multiple times?
– Piovezan
Sorry I didn’t have an example, I generated Ports in the past company, but I think we passed the content of subreports as parameters to the Jasperfillmanager, and the
JRDatasource
using Jrbeancollectiondatasource with an empty collection.– nullptr
In our case we didn’t pass the connection directly to the report due to Tomcat pool depletion problems, so we searched all the information before and passed the parameters to the report.
– nullptr
I hope it helps you :)
– nullptr