I have done some research on subreports and have even built report that use several subreports.
I am having an issue combining 2 already made reports so that they bo
You have 2 options
1. Combine report creating a main report and include you reports in this as subreport's. You need to set margin to 0, whenNoDataType="AllSectionsNoDetail"
and for example use the summary
band to generate new page for report2 setting isSummaryNewPage="true"
. You do not need to change any queries, since you simple pass the report connection to your reports (subreports).
Example
2. Concatenate the report's during exporting
Example (pdf export is similar with other types of export)
Map paramMap = new HashMap();
List jasperPrintList = new ArrayList();
JasperPrint jasperPrint1 = JasperFillManager.fillReport(report1, paramMap);
jasperPrintList.add(jasperPrint1);
JasperPrint jasperPrint2 = JasperFillManager.fillReport(report2, paramMap);
jasperPrintList.add(jasperPrint2);
JRPdfExporter exporter = new JRPdfExporter();
exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList)); //Set as export input my list with JasperPrint s
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput("output.pdf")); //or any other out stream
SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration();
exporter.setConfiguration(configuration);
exporter.exportReport();