How to collate multiple jrxml jasper reports into a one single pdf output file

后端 未结 5 680
一个人的身影
一个人的身影 2020-11-30 08:06

I have to prepare reports using five different sql queries. Each query will give out one report table.

So I wrote 5 jrxml files each corresponding to one of the abov

5条回答
  •  旧巷少年郎
    2020-11-30 08:36

    you can try this one

    JasperPrint jp1 = JasperFillManager.fillReport(reportFile1,reportParams,Connection);  
    JasperPrint jp2 = JasperFillManager.fillReport(reportFile2,reportParams,Connection);  
    for (int j = 0; j < jp1.getPages().size(); j++) {  
        //Add First report to second report
        jp2.addPage((JRPrintPage) jp1.getPages().get(j));  
    } 
    

提交回复
热议问题