使用Jasper Report导出到带有嵌入式图像的单个HTML [英] Export to single HTML with embedded images using Jasper Report

查看:118
本文介绍了使用Jasper Report导出到带有嵌入式图像的单个HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我将jasper报告输出为单个Excel文件,PDF,RTF。
但多重播放HTML文件。
我管理单个报告文件时很麻烦,但是在HTML情况下很多文件和文件夹。

解决方案

不要认为碧玉报告已经建立了对此的支持,所以你不得不推出自己的实现。您可以使用这种技术来嵌入图像。

 < img src =data:image / png; base64,iVBORw0K。 ../>因此,首先使用java的xml解析器来查找html  http://www.mkyong.com/tutorials/java-xml-tutorials/ 。然后你会阅读所有的文件,将它们转换为base64字符串 http://www.xinotes。 org / notes / note / 736 / ,并用上面的格式替换 img 的src。  

Can Jasper Report export to single HTML with embedded images?

I have output of jasper reports as single Excel file, PDF, RTF. But multiplay HTML files. It trouble for me to manage not single report file, but many files and folders in HTML case.

解决方案

I don't think that jasper reports has built in support for this, so you'd have to roll out your own implementation. You can use this technique to embed them images.

<img src="data:image/png;base64,iVBORw0K... " />

So first you'd use java's xml parser to find all the image tags in the html http://www.mkyong.com/tutorials/java-xml-tutorials/. Then you'd read all the files, convert them to base64 string http://www.xinotes.org/notes/note/736/ and replace the img's src with the above format.

这篇关于使用Jasper Report导出到带有嵌入式图像的单个HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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