如何关闭 JasperReports 为 HTML 报告生成的图像文件名?
我有一份 Jasper 报告,该报告会在预定时间通过 Quartz 发送出去。 JasperReports 生成标记后,我将其放入发送给客户的电子邮件中。此主报告中有几个子报告,主报告底部有页脚图像。 images src 值指向生成的图像文件名(Jasper 制作的,即:blah/img_0_0_13)。我设置了一个 Web 服务器来保存报告生成的 HTML 文件,以便可以在任何地方访问它们,即: http://example.com/jasperreport/images/thisreallysucks/SampleReport.html_files/img_0_0_13
所以我的问题是如何关闭这个疯狂的文件名生成并只使用一些简单的东西,即: http://example.com/jasperreport/images/thisdoesntsuckasbad/SampleReport.html_file/example_logo.gif
我将 JRHtmlExporterParameter.IMAGES_URI 设置为指向包含图像的 Web 服务器。
另一个大问题是,如果由于缺乏数据而丢失任何子报告,那么生成的图像文件就会发生变化。我有 4 个子报告...
I have a Jasper report that gets sent out at a scheduled time via Quartz. After JasperReports generates the markup I shove it into an email that goes out to the customer. There are several sub-reports inside this main report with footer images at the bottom of the main report. The images src values point back to the generated image file name (the one's Jasper makes, ie: blah/img_0_0_13). I setup a web server to hold the report's generated HTML files, so they can be accessed anywhere, ie: http://example.com/jasperreport/images/thisreallysucks/SampleReport.html_files/img_0_0_13
So my question is how do I turn off this crazy file name generation and just use something simple ie: http://example.com/jasperreport/images/thisdoesntsuckasbad/SampleReport.html_file/example_logo.gif
I am setting JRHtmlExporterParameter.IMAGES_URI to point to web server with the images.
Another big problem with this is if any of the sub-reports are missing due to lack of data, then the generated files for the images change. I have 4 sub-reports...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
<一href="http://books.google.com/books?id=LWTbssKt6MUC&pg=PA197&lpg=PA197&dq=jasperreport+the+best+way+to+handle+html+images&source=bl&ots =aSG-engMXd&sig=U7XuZ WQs8dseDCwW9ZWAbJG_qT4&hl=en&sa=X&ei=by4fT6nHNsbL0QGA3fEG&ved=0CH0Q6AEwCQ# v=onepage&q=jasperreport%20the%20best%20way%20to%20handle%20html%20images&f=false" rel="nofollow">http://books.google.com/books?id=LWTbssKt6MUC&pg=PA197&lpg=PA197&dq=jasperreport+the+best+way+to+handle+html+images&source= bl&ots=aSG-engMXd&sig=U7 XuZWQs8dseDCwW9ZWAbJG_qT4&hl=en&sa=X&ei=by4fT6nHNsbL0QGA3fEG&ved=0CH0Q6AEwCQ# v=onepage&q=jasperreport%20the%20best%20way%20to%20handle%20html%20images&f=false
iReport 中的图像有一个“Is Lazy”设置,它可以满足我的需求。
http://books.google.com/books?id=LWTbssKt6MUC&pg=PA197&lpg=PA197&dq=jasperreport+the+best+way+to+handle+html+images&source=bl&ots=aSG-engMXd&sig=U7XuZWQs8dseDCwW9ZWAbJG_qT4&hl=en&sa=X&ei=by4fT6nHNsbL0QGA3fEG&ved=0CH0Q6AEwCQ#v=onepage&q=jasperreport%20the%20best%20way%20to%20handle%20html%20images&f=false
There is a "Is Lazy" setting in iReport for images, which does what I want.