将参数传递给pentaho CDE报告 [英] Pass parameter to pentaho CDE report

查看:188
本文介绍了将参数传递给pentaho CDE报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在此报告中创建了一个CDE参数报告,我想通过url传递参数,如下所示,我的CDE报告链接

I created a CDE parameter report in this report I want pass parameter through url my CDE report link as below

http://localhost:8080/pentaho/content/pentaho-cdf-dd/Render?solution=demo&path=&file=pass_parameter.wcdf&userid=joe&password=password

和我的cda查询网址如下

and my cda query url as below

http://localhost:8080/pentaho/content/cda/doQuery?path=demo/pass_parameter.cda&dataAccessId=jdbc&paramdeviceType=deviceType

在上面的cda查询网址中,如果我通过如下的deviceType

In above cda query url if I pass deviceType as below

http://localhost:8080/pentaho/content/cda/doQuery?path=demo/pass_parameter.cda&dataAccessId=jdbc&paramdeviceType=Linux

它向我展示了浏览器中json格式的输出.因此,我在jsp页面上的iframe中使用了CDE报告,并且我通过了第一个URL.我想在第一个网址中传递deviceType参数,例如

It shows me a json formatted output in browser. So I used CDE report in iframe on my jsp page and that iframe I pass first url. I want to pass deviceType parameter in my first url like

 http://localhost:8080/pentaho/content/pentaho-cdf-dd/Render?solution=demo&path=&file=pass_parameter.wcdf&userid=joe&password=password&deviceType=Linux

但是它不显示任何输出,如何通过url传递参数?

but it not display any output, how I pass parameter through url?

推荐答案

经过长时间的研究,我找到了解决问题的方法. 首先在我的jndi查询组件中查询所需的属性值,然后为此属性值通过url传递,我选择了一个组件参数并编写如下的javascript代码

After long researching I found solution of my questions. First in my jndi query component query required attribute value and that attribute value I want to pass through url for this I select one component parameter and write javascript code as below

function() 
{ 
  cname = Dashboards.getQueryParameter('name');
 } 

您还可以在执行前将此脚本添加到您的组件中,并将参数名称添加为cname值以及cname,我的查询将添加为select * from table name where cname=${cname}.然后在我的iframe网址中传递如下参数

you can also this script to your component under pre execution and add parameter name as cname value also cname and my query will select * from table name where cname=${cname}. and in my iframe url I pass argument as below

http://localhost:8080/pentaho/content/pentaho-cdf-dd/Render?solution=demo&path=&file=pass_parameter.wcdf&userid=joe&password=password&name=Linux

它显示了我想要的结果.

and it shows me a results which I want.

这篇关于将参数传递给pentaho CDE报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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