且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将JasperViewer与基于Swing的应用程序集成

更新时间:2023-02-07 23:08:25

是的,Jasper Reports带有一个可用的(虽然很简单)报表查看器:

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);
...

最后一行是显示查看器的内容。不过,我不确定你是否可以将可用的输出格式限制为PDF。

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