使用xpath和xml作为数据源时如何在Ireport 4.5中使用参数
有谁知道如何在 Ireport 中使用 xpath 中的参数。我正在使用 4.5
我有这样的东西可以工作:
<fieldDescription><![CDATA[origin/localizedNames/name[@lang = "en"]]]></fieldDescription>
我想做的是类似
<fieldDescription><![CDATA[origin/localizedNames/name[@lang = "$P{lang}"]]]></fieldDescription>
Where lang is my parameter...但它似乎不起作用,我在网上找不到任何例子。
提前致谢, 迪米特里
Does anyone know how to use a parameter within and xpath in Ireport. I am using 4.5
I have something like this that works:
<fieldDescription><![CDATA[origin/localizedNames/name[@lang = "en"]]]></fieldDescription>
and what i want to do is something like
<fieldDescription><![CDATA[origin/localizedNames/name[@lang = "$P{lang}"]]]></fieldDescription>
Where lang is my parameter... but it does not seem to work and i cant find any example on the net.
thanks in advance,
Dimitri
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在
XPath
表达式中使用参数
。示例:
您可以在 JasperReports 分发包。
您还可以阅读这篇文章,了解
XPath
使用。You can use
parameters
inXPath
expressions.The sample:
You can find the sample in folder
%jasperreports%\demo\samples\xmldatasource
from JasperReports distribution package.You can also read this article about
XPath
using.