I am currently experimenting on a multi-value parameter report in order to eliminate the need of launching several reports in several tabs and instead showing copies of letters in one report, multi-page. I am still using version 2.5.0 designer for my design work.<br />
<br />
In the report end I have also implemented a beforeOpen script (similar to Jason's <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/688-using-a-multivalue-parameter-in-an-in-clause/#description'>example</a>) even that will allow multi-value parameter and set the parameter to allow multi-values dynamically.<br />
<br />
My beforeOpen script even is as follows:<br />
<br />
var parmcount = params["P_POL_SYS_ID"].value.length;<br />
var andclause = "";<br />
<br />
if( parmcount > 0 ){<br />
andclause = " AND TO_CHAR(POL_SYS_ID) IN ( ";<br />
}<br />
for( i=0; i < parmcount; i++ ){<br />
<br />
if (typeof params["P_POL_SYS_ID"].value
== 'string'){<br />
var o = parseInt(params["P_POL_SYS_ID"].value);<br />
}<br />
<br />
if( i == 0 ){<br />
andclause = andclause + o;<br />
}else{<br />
andclause = andclause + " , " + o; <br />
}<br />
}<br />
if( parmcount > 0 ){<br />
this.queryText = this.queryText + andclause + " ) ";<br />
}<br />
<br />
In the application front end, the values area submitted from Hiddenfields. Value of hiddenfields are in string form. But when we try to pass the parameter values to the report end, the error message I obviously get is the The type of parameter "" is expected as "Object[]", not "java.lang.String". In the report end, the parameter taken would be in Decimal - as if I attempt to enter in String form, there is no data from the result set. I also have tried converting the value to object or parsing it in Integer, but no luck.<br />
<br />
From what I recall, there are similar cases like mine. Could it be that the listbox in the report end is taken in object, not string. I am not sure whether it is a bug in 2.5.0 that has been rectified in later versions. <br />
<br />
Is there anyway I can convert that to objects?<br />
<br />
Thanks.