如何关闭 JasperReports 为 HTML 报告生成的图像文件名?

发布于 2024-12-28 13:21:18 字数 816 浏览 2 评论 0原文

我有一份 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

诠释孤独 2025-01-04 13:21:18

“延迟加载的图像没有指定名称,因为它们应该由浏览器从 HTML 渲染时可用的公共 URL 加载。”

<一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”设置,它可以满足我的需求。

"Lazy loaded images are not given a name, because they are supposed to be loaded by the browser from a public URL available at HTML-rendering time."

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文