How to integrate JasperViewer with Swing based application

前端 未结 2 1014

can I integrate the JasperReports Viewer to my Swing application as like if I click on view report button from my application then viewer should be opened. If so could you advis

2条回答
  •  猫巷女王i
    2021-01-25 22:11

    Yes you can, Jasper Reports come with a usable (albeit simple) report viewer:

    ...
               JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
               JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport...);
               JasperViewer.viewReport(jasperPrint);
    ...
    

    The last line is what displays the viewer. I'm not sure if you can restrict the available output formats to PDF, though.

提交回复
热议问题