One page property page in JasperReports

I have a requirement when I need to create a report in JasperReports. The report consists of 4 sheets. The first sheet has 5 pages, and similarly the other sheets have one or two pages. The problem that I encountered is to use net.sf.jasperreports.export.xls.one.page.per.sheet and set it to true , then all the pages fall into different sheets. I need to create a report so that some pages fall on one sheet and some pages on another sheet.

Can this be done?

+3
source share
1 answer

, 4 , , Ignore Pagination true ( jasperReport jrxml, isIgnorePagination="true").

:

List<JasperPrint> jasperPrintList = new ArrayList<JasperPrint>();
jasperPrintList.add(JasperFillManager.fillReport("report1.jasper", params1));
jasperPrintList.add(JasperFillManager.fillReport("report2.jasper", params2));
jasperPrintList.add(JasperFillManager.fillReport("report3.jasper", params3));
jasperPrintList.add(JasperFillManager.fillReport("report4.jasper", params4));

JRXlsExporter exporter = new JRXlsExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, jasperPrintList);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "BatchExportReport.xls");
exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

exporter.exportReport();

, , JasperForge.

</" > , . excel , . , , , . params1, params2, params3 params4:

if(exportFormat == EXCEL) {
   params1.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
   params2.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
   params3.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
   params4.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
}
+8

All Articles