Jasper Reports (Sub Reports)

I'm using JasperReport, a requirement is the possibility to produce a multiple page report in which every page contains a different report.

Example:
Page 1 contains an actual invoice for a customer
Page 2 contains the invoices list for the customer
Page 3 contains a graph of amount of invoices by year
Page 4 contains only fixed text (say operator instructions ...)

Is it possible to create such a unique report instead of creating four standalone report and then merge the pdfs.

Please help me with some code example and some possible tutorials.

Thanks,
Praveen
PraveenKumarGautamAsked:
Who is Participating?
 
objectsCommented:
try something like this:

List<Object> list = new ArrayList<Object>();
JRPdfExporter exp = new JRPdfExporter();
pageOne = JasperFillManager.fillReport(jasperReport, jasperParameter, con);
list.add(pageOne);
list.add(...
 
exp.setParameter(JRPdfExporterParameter.JASPER_PRINT_LIST, list);
exp.setParameter(JRPdfExporterParameter.OUTPUT_FILE, new File("test.pdf"));
exp.exportReport();
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.