pentaho - 将参数传递给 pentaho CDE 报告

标签 pentaho pentaho-cde

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

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

和我的 cda 查询 url 如下

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

如果我按如下方式传递 deviceType,则在上面的 cda 查询 url 中

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

它在浏览器中显示了一个 json 格式的输出。所以我在我的 jsp 页面上的 iframe 中使用了 CDE 报告,并且我传递了第一个 url。我想在我的第一个 url 中传递 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

它显示了我想要的结果。

关于pentaho - 将参数传递给 pentaho CDE 报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20377363/

相关文章:

javascript - 如何在日期中减去年份并添加月份?

charts - Pentaho CDE 图表

javascript - 如何使用 POST 方法在 Pentaho 中调用另一个仪表板

pentaho-cde - Pivot4J 未显示 int Pentaho 业务分析 - 社区版

java - 错误: Unable to publish yor file in pentaho?

postgresql - 当我将数据从 DB2 复制到 Postgres 时,如何将字符代码从 Shift-JIS 更改为 UTF-8?

Pentaho ETL : Modified Javascript Step "SKIP_TRANSFORMATION" transformation Constant work logic

pentaho水壶: get row count from stream

javascript - 在 Pentaho CDE 上为检查组件设置不同的值和标签

postgresql - 在 pentaho 中插入/更新行时出错?