iReport 和外部对象
我正在尝试在我的报告中使用外部对象。
- 我将带有外部对象的 jar 文件添加到 iReport 类路径(在设置中)
- 静态文本(使用 I18n)
msg($R{pdf.invoice.finalTitle}, $P{invoice.number})
- 我已将此类定义添加到 xml 中:
<import value="crm.object.objects.Invoice"/>
<parameter name="invoice" class="crm.object.objects.Invoice" isForPrompting="false">
<property name="number" value=""/>
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
...
但在编译过程中仍然失败,并出现错误: net.sf.jasperreports.engine。 design.JRValidationException:报告设计无效: 1. 未找到参数 : invoice.number
我做错了什么? 谢谢
I am trying to use an external objects in my report.
- I added the jar file with external objects to iReport classpath (in settings)
- The static text (with I18n)
msg($R{pdf.invoice.finalTitle}, $P{invoice.number})
- I have added such definitions into xml:
<import value="crm.object.objects.Invoice"/>
<parameter name="invoice" class="crm.object.objects.Invoice" isForPrompting="false">
<property name="number" value=""/>
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
...
But still it fails during compilation with error: net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 1. Parameter not found : invoice.number
What I am doing wrong?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您定义的参数是“invoice”,而不是“invoice.number”。所以,它应该是$P{invoice}。然后,如果它有足够的访问权限,您就可以访问它的变量...或者通过它的 getter,如 $P{invoice}.getNumber()
The parameter you have defined is "invoice", not "invoice.number". So, it should be $P{invoice}. You can then access it's variable, if it has enough access privileges...or by it's getter, as $P{invoice}.getNumber()