问题描述
我有一个Jasper报告,它会在预定时间通过Quartz发送出去。在JasperReports生成标记之后,我将其推送到一封发给客户的电子邮件中。此主报告中有几个子报告,主报告底部有页脚图像。图像src值指向生成的图像文件名(一个人的Jasper制作,即:blah / img_0_0_13)。我设置了一个Web服务器来保存报告生成的HTML文件,因此可以在任何地方访问它们,即:
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
我将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...
推荐答案
iReport中有一个Is Lazy设置用于图像,可以满足我的需求。
There is a "Is Lazy" setting in iReport for images, which does what I want.
这篇关于如何为HTML报告关闭JasperReports生成的图像文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!