SpagoBI多值参数 [英] SpagoBI multi value parameter

查看:105
本文介绍了SpagoBI多值参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在SpagoBI中创建一个多值参数.

I'm trying to create a multi-value parameter in SpagoBI.

这是我的数据集查询,其最后一行似乎引起了问题.

Here is my data set query whose last line appears to be causing an issue.

select C."CUSTOMERNAME", C."CITY", D."YEAR", P."NAME"
from "CUSTOMER" C, "DAY" D, "PRODUCT" P, "TRANSACTIONS" T
where C."CUSTOMERID" = T."CUSTOMERID"
and D."DAYID" = T."DAYID"
and P."PRODUCTID" = T."PRODUCTID"
and _CITY_

我在数据集中的打开脚本之前创建了这样的文件:

I created before open script in my dataset which looks like this:

this.queryText = this.queryText.replace(_CITY_, " CUSTOMER.CITY in ( "+params["cp"].value+" ) "); 

我的参数设置为字符串,显示类型为动态列表框.

My parameter is set as string, display type dynamic list box.

运行报告时出现错误.

org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "
this.queryText = this.queryText.replace(_CITY_, " CUSTOMER.CITY in ( "+params["cp"].value+" ) "); 
":
Fail to execute script in function __bm_beforeOpen(). Source:

有人可以帮助我吗?

推荐答案

你好,我设法解决了这个问题.这是我的代码:

Hello I managed to solve the problem. Here is my code:

var substring = "" ;
var strParamValsSelected=reportContext.getParameterValue("citytext");
substring += "?," + strParamValsSelected ;
this.queryText = this.queryText.replace("'xxx'",substring);

您可以看到?"在我的参数之前是必需的.也许它将帮助某人.非常感谢您的评论.

As You can see the "?" is necessary before my parameter. Maybe It will help somebody. Thank You so much for Your comments.

这篇关于SpagoBI多值参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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