我在我的项目中使用 jasper 报告来生成 html 报告。但是生成的报告是静态的。现在我们想在其中添加一些交互功能,比如简单的列排序和搜索。这最好在客户端完成。如何实现?到目前为止,我已经尝试将 jquery 嵌入到生成的报告中,但没有成功。jasper 报告是否提供这种功能?
4 回答
根据您对“交互式”一词的含义,不,这是不可能的。报表只是一个报表 - 一种以业务规则要求的方式显示数据的呈现媒体。您可以在此处格式化数据。您可以对其进行样式化,添加图像等等。客户端应用程序可能是您想要的。
每次要过滤数据时,使用参数并重新编译报告。
Well, your exact requirement can be achieved if you publish the Jasper Reports on the Jasper Server. Once published, all your reports become interactive (For Charts, you must use the PRO charts and not the basic HTML charts but for tables, it works automatically.)
Once you publish it on the Jasper Server, the features that you get are:
- Sort button with various types
- Export the Report to many formats (PDF, XML, etc - more than 10).
- Zoom IN and Zoom Out.
- Bubble for your charts making them interactive, etc.
是的,Jasper Reports 中的交互性是可能的,但问题是您需要一个 Jasper Server Pro 或 Enterprise 版本来实现这一点。如果您使用的是社区版本,则无法创建交互式报告。您可以从此链接https://www.jaspersoft.com/download下载 60 天的免费试用版 jasper 服务器
有关更多详细信息,请访问此链接https://www.jaspersoft.com/community-commercial
根据您的要求选择。