如何在 JasperReports 中从 Java 向报表传递多个参数并导出为 PDF
我正在尝试使用 Jasper Reports 来帮助在我的应用程序中进行报告。我必须以 HTML (JSP) 格式显示报告,并且还需要能够从我的网页中将报告导出为 PDF。
我的大多数报告都需要多个参数,而且我不知道如何将它们从我的 Servlet(如果我必须将它们传递到那里)传递到报告。
PS:我没有使用任何类型的框架,如果您能建议一个无框架的实现,那就太好了。
I'm trying to use Jasper Reports to help with reporting in my application. I will have to display my reports in HTML (JSP) and would also need to be able to export the reports to PDF from within my web page.
Most of my reports require multiple parameters, and I can't figure out how to pass them from my Servlet (if I have to pass them there) to the report.
P.S: I'm not using frameworks of any sort, it would be great if you could suggest a framework free implementation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你可以像这样使用HashMap
you can use HashMap like
这个示例将为您提供帮助,它不需要任何框架。它将报告导出为 PDF。你可以像 Anil 已经解释的那样使用 map
来传递多个参数。
This example will help you, it doesn't require any framework. It exports the report as a PDF. And you can use map as Anil had already explained
to pass multiple parameters.