<p>HI, All,</p>
<p>Birt 3.7, the report needs two two parameters, let's say parA and parB, both are not required and but can with multiple values. And here is the way I set for both parameters:</p>
<p>var parAArray=new Array();<br>
parAArray=params["parA"].toString().split(",");<br>
var myparA="(";<br><br>
for(var parACount = 0; parACount < parAArray.length; parACount++){<br>
myparA = myparA + "'" + BirtStr.trim(parAArray[parACount].replace("=","")) + "'";<br>
if(parACount+1 < parAArray.length){<br>
myparA = myparA + ", ";<br>
}<br>
}<br>
myparA = myparA + ")";</p>
<p> </p>
<p>the query is just select some data from tables.</p>
<p> </p>
<p>After the query, I added this:</p>
<p>if(params["parA"].value != "" && params["parA"].value != null){<br>
sqlText = sqlText + " and tableA.columnA in " + myparA ;<br>
}</p>
<p> </p>
<p>if the parameter has value, the report runs ok, but if null, the below error shows up.</p>
<p> </p>
<p>Here is the error info:</p>
<p>maximoDataSet.setQuery(sqlText); + "<br>
<br>
A BIRT exception occurred. See next exception for more information.<br>
Error evaluating Javascript expression. Script engine error: TypeError: Cannot convert null to an object. (/report/data-sets/script-data-set[
@id="5"]/method[
@name="open"]#7)<br>
Script source: /report/data-sets/script-data-set[
@id="5"]/method[
@name="open"], line: 0, text:<br>
__bm_OPEN(). (Element ID:1)</p>
<p> </p>
<p>Thanks very much for your help!</p>