如何将JasperViewer与基于Swing的应用程序集成 [英] How to integrate JasperViewer with Swing based application

查看:90
本文介绍了如何将JasperViewer与基于Swing的应用程序集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以将JasperReports Viewer集成到我的Swing应用程序中,就像我点击应用程序中的查看报告按钮一样,然后应该打开查看器。如果是这样,你可以告诉我这个集成的代码片段,在这个查看器中,应该仅限制PDF格式而不是每个其他可用的下载选项过滤器。

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 advise me with code snippet for this integration and in this viewer the save as type should be restricted for PDF only rather than every other download option filter available.

请在这方面给我建议。

推荐答案

是的,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.

这篇关于如何将JasperViewer与基于Swing的应用程序集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆