net.sf.jasperreports.engine.JRException:找不到字节数据 [英] net.sf.jasperreports.engine.JRException: Byte data not found
本文介绍了net.sf.jasperreports.engine.JRException:找不到字节数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试传递给jasper报告字符串位置的模板。所以我在模板和值中传递参数的键。当我在项目中有图像时,一切都在工作,但我希望在另一个地方有它。有没有办法从中读取参数,例如属性文件?我不知道为什么这个解决方案不起作用:
I'm trying to pass to template of a jasper reports string location. So I'm passing key of a parameter inside template and value. Everything was working when I had image inside my project, but I would like to have it on the other place. Is there any way to read parameters from, for instance properties file? I don't know why this sollution is not working:
我的形象:
<parameter name="imagesDir" class="java.lang.String" isForPrompting="false"/>
...
<image isLazy="true">
<reportElement key="image-1" style="PHLabel" x="0" y="0" width="160" height="33"/>
<imageExpression class="java.lang.String"><![CDATA["$P{imagesDir}"+"logo.bmp"]]></imageExpression>
</image>
错误:
Error during exporting report statement_account_10 to PDF.
net.sf.jasperreports.engine.JRException: Byte data not found at :
((java.lang.String)parameter_imagesDir.getValue())logo.bmp
推荐答案
好的我发现它...
应该是:
Ok i found it... Should be:
<image isLazy="true">
<reportElement key="image-1" style="PHLabel" x="0" y="0" width="160" height="33"/>
<imageExpression class="java.lang.String"><![CDATA[$P{imagesDir}+"logo.bmp"]]></imageExpression>
</image>
这篇关于net.sf.jasperreports.engine.JRException:找不到字节数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文