【发布时间】:2014-02-07 02:45:20
【问题描述】:
我有一个(半)基本数据立方体,其中包含状态和区域的级联参数。状态选择框和区域一样直截了当;当用户选择一个州时,相应地设置区域选项。但是,Area 的值是一长串字符串,它将被发送到 mysql select 语句,该语句将多次使用这两个参数(状态和来自 Area 的字符串列表)。它是一个丑陋的 UNIONS 集合。我的问题是在开始之前和查询时间之间。
//beforeOpen script...LState & LAreas the name of the report param
this.queryText = this.queryText.replace('stateList', params["LStates"].value);
this.queryText = this.queryText.replace('areaList', params["LAreas"].value);
In my mysql statement I use them in the following way:
SELECT ..XXX..
FROM ..XXX..
WHERE ..XXX..
State.State_Location in ('stateList')
AND Range_Locator.Range in ('areaList')
UNION ALL
SELECT ..XXX..
FROM ..XXX..
WHERE ..XXX..
State.State_Location in ('stateList')
AND Range_Locator.Range in ('areaList')
我从 BIRT 得到的两个错误是:
(很明显)
- 无法获取结果集。 org.eclipse....SQL 语句不返回 ResultSet 对象。
(对我来说不是那么明显)
- 发生 BIRT 异常。评估 Javascript 表达式时出错。脚本引擎错误:找不到方法 java.lang.String.replace(string.java.lang.Object[])。 有错误评估脚本“this.queryText = this.queryText.replace('stateList', params["LStates"].value);this.queryText = this.queryText.replace('areaList', params["LAreas"] 。价值);”
有什么想法吗?任何帮助将不胜感激。
【问题讨论】:
标签: birt