Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Jasper Reports (Sub Reports)

Posted on 2011-05-03
2
Medium Priority
?
425 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:PraveenKumarGautam
2 Comments
 
LVL 92

Expert Comment

by:objects
ID: 35517245
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
 
LVL 21

Accepted Solution

by:
Amitkumar P earned 2000 total points
ID: 35672534
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month20 days, 22 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question