Pass parameter to pentaho CDE report

醉酒当歌 提交于 2019-12-06 09:25:13

问题


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

and my cda query url as below

http://localhost:8080/pentaho/content/cda/doQuery?path=demo/pass_parameter.cda&dataAccessId=jdbc&paramdeviceType=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

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

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


回答1:


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');
 } 

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.



来源:https://stackoverflow.com/questions/20377363/pass-parameter-to-pentaho-cde-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!