我有一个BIRT报告,它使用如下查询。

select Dealer, Namefrom customerA where id = ? union allselect Code as Dealer, last_name as Namefrom customerB where id = ? union allselect Num as Dealer, owner as Namefrom customerC where id = ?

我在报告本身中有一个输入文本框,并且有一个刷新按钮可以重新加载报告。
我的报告也有名为“ CUST_ID”的参数,我在数据集中将其绑定为param_1,param_2和param_3以替换为“?”执行时标记。

如果我在参数弹出屏幕上输入参数,报告工作正常,但我需要在文本框中输入ID,然后按相应的刷新链接重新加载报告。

如何添加输入的文本值(我知道我可以从脚本中获取它)并将其设置为报告参数“ CUST_ID”?

非常感谢您的帮助。

先感谢您。

最佳答案

通过使用BIRT中的脚本,我能够解决此问题。下面我列出了我要遵循的步骤。

1.添加一个脚本,该脚本将在页面加载时启动请求参数。
   我可以通过在常规javascript函数内使用var link=this;访问报告网址。

2.将我的参数附加到上述詹姆士提到的请求的末尾。谢谢詹姆斯。

3.替换新创建的url link.href=url;这将刷新输入框中输入的值的报告。

4.在数据集中,我将查询修改为'Select name from customerA',而没有任何where子句。

5.dataset beforeOpen脚本我添加了这些行,并相应地过滤了记录。

this.queryText += "where id ="+reportContext.getParameterValue("cust_id");
reportContext.setParameterValue("debug", this.queryText);

09-11 18:05
查看更多