<p>Hi,<br>
<br>
I recently started working on BIRT reports, so please bear with my queries.

<br>
<br>
I am trying to pass multiple values in a parameter used in IN clause in my Dataset SQL.<br>
<br>
SQL is: select id, descr from tcTable where ext_Id = ? and component_Type <strong>in (?);</strong><br>
<br>
Here from my JSP I am passing multiple values like "L,P,A" as the parameter value for componentType. Have added the Report Parameter rpComponentType as String. On Edit DataSet window, under Parameter section, linked it to rpComponentType. My report works fine if a single value is passed from JSP like "L". However it returns a blank report if multiple values are passed into it.<br>
<br>
I have gone through couple of links on internet and came across few suggestions: majorly to write a javascript piece in beforeOpen() of DataSet to replace the where clause portion. They have mentioned the solution is open to SQL injection, so not sure if it should be followed. Anyhow I tried the below code and it gave me the below error: <br><br>
if (params["rpComponentType"].value[0] != 'A') {<br>
this.queryText.replace(" AND COMPONENT_TYPE IN (?)", " AND COMPONENT_TYPE IN ('" + params["rpComponentType"].value.join("','") + "')");<br>
}<br><br><u>Getting this error: </u><br>
org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "if (params["rpComponentType"].value[0] != 'A') { this.queryText.replace(" AND COMPONENT_TYPE IN (?)", " AND COMPONENT_TYPE IN ('" + params["rpComponentType"].value.join("','") + "')"); }": Fail to execute script in function __bm_beforeOpen(). Source:
" + if (params["rpComponentType"].value[0] != 'A') { this.queryText.replace(" AND COMPONENT_TYPE IN (?)", " AND COMPONENT_TYPE IN ('" + params["rpComponentType"].value.join("','") + "')"); } + "
A BIRT exception occurred. See next exception for more information. TypeError: Cannot find function join in object L, P. (/report/data-sets/oda-data-set[
@id="2666"]/method[
@name="beforeOpen"]#3).<br>
<br>
<br>
I am not sure the way I implemented is correct. Is there a better way to fix this? Would appreciate any help with this.<br>
<br>
My BIRT version is 4.4.1<br>
<br>
<br>
Thanks,<br>
Shweta</p>