我在此报告中创建了一个 CDE 参数报告,我想通过 url 传递参数,我的 CDE 报告链接如下
http://localhost:8080/pentaho/content/pentaho-cdf-dd/Render?solution=demo&path=&file=pass_parameter.wcdf&userid=joe&password=password
我的 cda 查询网址如下
http://localhost:8080/pentaho/content/cda/doQuery?path=demo/pass_parameter.cda&dataAccessId=jdbc¶mdeviceType=deviceType
在上面的 cda 查询 url 中,如果我传递 deviceType 如下
http://localhost:8080/pentaho/content/cda/doQuery?path=demo/pass_parameter.cda&dataAccessId=jdbc¶mdeviceType=Linux
它在浏览器中向我显示了 json 格式的输出。因此,我在 jsp 页面上的 iframe 中使用了 CDE 报告,并且我传递了第一个 url 的 iframe。我想在我的第一个网址中传递 deviceType 参数,例如
http://localhost:8080/pentaho/content/pentaho-cdf-dd/Render?solution=demo&path=&file=pass_parameter.wcdf&userid=joe&password=password&deviceType=Linux
但它不显示任何输出,我如何通过 url 传递参数?
经过长时间的研究,我找到了我的问题的解决方案。
首先在我的 jndi 查询组件中查询所需的属性值以及我想要通过 url 传递的属性值,我选择一个组件参数并编写如下 JavaScript 代码
function()
{
cname = Dashboards.getQueryParameter('name');
}
您还可以将此脚本添加到预执行下的组件中,并将参数名称添加为 cname 值,同时 cname 和我的查询将select * from table name where cname=${cname}
。在我的 iframe url 中我传递参数如下
http://localhost:8080/pentaho/content/pentaho-cdf-dd/Render?solution=demo&path=&file=pass_parameter.wcdf&userid=joe&password=password&name=Linux
它向我展示了我想要的结果。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)