Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
passing parameters to list in birt
rreddy
Hi
We are using birt report engine to send parameters to report and run it.
Please suggest how to send a parameters if the parameter in report is of type list. Please also suggest if the Parameter type is selected as list in Birt designer, how should the query look.
Thank You.
Find more posts tagged with
Comments
JasonW
Is the parameter multi-select? if so you can set it similar to the following in the API.<br />
String parmvals[] = new String[2];<br />
parmvals[0]="10104";<br />
parmvals[1]="10108";<br />
<br />
task.setParameterValue("NewParameter", parmvals);<br />
I am not sure what you mean by in the query. If you use script you can always access the parameter values of a list and modify a query. Use a beforeOpen script similar to the following:<br />
<br />
var parmcount = params["parmorders"].value.length<br />
var whereclause = "";<br />
if( parmcount > 0 ){<br />
whereclause = " where ordernumber in ( ";<br />
}<br />
for( i=0; i < parmcount; i++ ){<br />
if( i == 0 ){<br />
whereclause = whereclause +params["parmorders"].value
;<br />
}else{<br />
whereclause = whereclause + " , " + params["parmorders"].value
; <br />
}<br />
}<br />
if( parmcount > 0 ){<br />
this.queryText = this.queryText + whereclause + " ) ";<br />
}<br />
<br />
Jason
rreddy
Thank You. It worked.