【问题标题】:SpagoBI Studio Passing Strings as Multivalue ParameterSpagoBI Studio 将字符串作为多值参数传递
【发布时间】:2016-06-28 14:15:00
【问题描述】:

我必须将字符作为多个值传递(例如:'Products'、'Terms'、'Parts'、....),而不是 id。

在浏览了几篇关于在单个参数上传递多个值的帖子后,我在 BIRT 数据集中将我的 sql 写为

select m.country,tp.categoryLev1 ,tp.categoryLev2,m.sentiment,
(case when m.sentiment=1 then 'S1' when m.sentiment=2 then 'S2'
when m.sentiment=3 then 'S3' when m.sentiment=4 then 'S4' end) as rating
from mentionmysql.topic tp
join mentionmysql.master m on m._id=tp._id
where m.Country like ? and tp.categoryLev1 IN ('xxx')
and m.MentionCreatedDate 
between str_to_date(?,'%d/%m/%Y') and str_to_date(?,'%d/%m/%Y');

并在打开之前为与 , 相同的数据集编写脚本,

this.queryText =      this.queryText.replace("xxx",params["CategoryLev1"].value.join(","));

但我没有得到任何积极的结果。

仅供参考,我使用 spagobi studio(Eclipse 平台版本:Luna SR2 (4.4.2))来创建 BIRT 报告。

我的参数名称是 CategoryLev1。所有参数都定义为文本框,以便我可以将这些参数配置为 spagobi 服务器上的列表框。

谁能帮帮我。谢谢

【问题讨论】:

    标签: birt spagobi


    【解决方案1】:

    我遇到了类似的问题,把它放在 querytext.replace 之后为我工作:

    this.queryText = this.queryText.replace("''","'");
    

    【讨论】:

    • 感谢您的回复
    • 它有效吗?如果没有,帮助我解决这个问题的一个简单方法是在报告上打印查询文本,看看发生了什么
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-21
    • 2017-06-14
    • 2011-05-12
    相关资源
    最近更新 更多