要包含在网页中的 Java 报告库
我正在开发 Grails 应用程序,需要显示一些报告并允许用户以最常见的格式(PDF、XML...)导出它们。
我不想将 SQL 查询嵌入到报告定义中,报告逻辑已集成到 Grails 服务中,并且我正在寻找的报告库应该适用于没有真实数据源的数据集(可能是地图列表)。
我使用 Jasper Reports 和 iReport 进行测试,它们与 Grails 配合使用,可实现导出功能(PDF、XML、HTML)。但我很难将它们包含到我的页面模板中。我希望在报告 html 中包含页眉、页脚、导航菜单和过滤器。
我想到的唯一解决方案是使用 iframe,但我不太喜欢这个。
Jasper Report 可以满足我的要求吗?您是否知道任何其他 Java 报告库允许我将报告包含在 HTML 正文中?
I'm working on a Grails application and I need to display some reports and allow the users to export them in the most common formats (PDF, XML...).
I don't want to embed the SQL query into the report definition, the report logic is integrated into Grails services and the reporting library I'm looking for should work on a dataset (maybe a list of maps) without a real datasource.
I used Jasper Reports and iReport for my tests and they work great together with Grails for the exporting functionality (PDF, XML, HTML). But I have difficult including them into my page template. I would like to have my header, footer, navigation menu and filter within the report html.
The only solution that came in my mind was to use iframe but I don't like this so much.
Can Jasper Report address my request? do you know any other Java reporting library that allows me to include the report in my HTML body?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
g:include
标签包含控制器的响应:使用 Grails Jasper 插件,您的控制器将包含如下代码:
You can use the
g:include
tag to include a controller's response:Using the Grails Jasper plugin, your controller then would contain code like this:
有大量适用于 Java 的 Web 报告 API。看看这里:
http://java-source.net/open-source /图表和报告
There are plenty of web reporting apis for Java. Just take a look here:
http://java-source.net/open-source/charting-and-reporting