`
xfxlch
  • 浏览: 162685 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

ireport 合并两个pdf模板(jrxml格式)

    博客分类:
  • Java
阅读更多

由于扩展了功能,导致现在我们要有两套模板来生成报表,但是报表的数据可能包含了两个模板一起的情况,所以
如下:

JasperPrint jp1 = JasperFillManager.fillReport(url.openStream(), parameters,
                    new JRBeanCollectionDataSource(inspBean));
JasperPrint jp2 = JasperFillManager.fillReport(url.openStream(), parameters,
                    new JRBeanCollectionDataSource(inspBean));
List pages = jp2 .getPages();
            for (int j = 0; j < pages.size(); j++) {
            JRPrintPage object = (JRPrintPage)pages.get(j);
            jp1.addPage(object);

    }
    JasperViewer.viewReport(jp1,false);

 这样子就可以了
http://stackoverflow.com/questions/2666001/how-to-merge-two-pdf-documents-into-a-single-report-in-jasperreports

分享到:
评论
1 楼 a240682322 2015-09-06  
很感谢。
你的回答解决了我的问题。
谢谢您。

相关推荐

Global site tag (gtag.js) - Google Analytics