如何为HTML报告关闭JasperReports生成的图像文件名? [英] How to turn off JasperReports generated image file names for HTML reports?

查看:122
本文介绍了如何为HTML报告关闭JasperReports生成的图像文件名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jasper报告,它会在预定时间通过Quartz发送出去。在JasperReports生成标记之后,我将其推送到一封发给客户的电子邮件中。此主报告中有几个子报告,主报告底部有页脚图像。图像src值指向生成的图像文件名(一个人的Jasper制作,即:blah / img_0_0_13)。我设置了一个Web服务器来保存报告生成的HTML文件,因此可以在任何地方访问它们,即: http://example.com/jasperreport/images/thisreallysucks/SampleReport.html_files/img_0_0_13

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

所以我的问题是如何关闭这个疯狂的文件名生成,只是使用简单的东西,即: http:// example .com / jasperreport / images / thisdoesntsuckasbad / SampleReport.html_file / example_logo.gif

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

我将JRHtmlExporterParameter.IMAGES_URI设置为指向带有图像的Web服务器。

I am setting JRHtmlExporterParameter.IMAGES_URI to point to web server with the images.

另一个大问题是,如果由于缺少数据而丢失了任何子报告,则生成的图像文件会发生变化。我有4个子报告...

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...

推荐答案


延迟加载的图像没有给出名称,因为它们应该由浏览器从HTML呈现时可用的公共URL加载。

"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的%第二十条%20best%20way%20to%20handle%20html%20imag es& f = false

iReport中有一个Is Lazy设置用于图像,可以满足我的需求。

There is a "Is Lazy" setting in iReport for images, which does what I want.

这篇关于如何为HTML报告关闭JasperReports生成的图像文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆