There is no support for mixed landscape and portrait submission, in the future they will add an object call to JasperBook or something like that, where you can easily add different subtitles of different orientations, but at the moment you are simulating this by making different reports and join them before their show.
those.
// Create reports separately
InputStream report1 = (InputStream) getClass().getResourceAsStream("/com/app/jasper/reportPortrait.jasper"); InputStream report2 = (InputStream) getClass().getResourceAsStream("/com/app/jasper/reportLandscape.jasper"); InputStream report3 = (InputStream) getClass().getResourceAsStream("/com/app/jasper/reportPortrait.jasper"); JasperPrint jasperPrint = JasperFillManager.fillReport(report, map, conn); JasperPrint jasperPrint2 = JasperFillManager.fillReport(report2, map, conn); JasperPrint jasperPrint3 = JasperFillManager.fillReport(report3, map, conn); JRPdfExporter exp = new JRPdfExporter();
// Add JasperPrint objects to ArrayList
List list = new ArrayList(); list.add(jasperPrint); list.add( jasperPrint2 ); list.add(jasperPrint3);
// And ask the exporter to join the list of reports.
exp.setParameter(JRPdfExporterParameter.JASPER_PRINT_LIST, list); exp.setParameter(JRExporterParameter.OUTPUT_STREAM, response.getOutputStream()); exp.exportReport();
I do this in my reports and it works. Good luck
source share