Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Best way to handle multi select parameter in BIRT 3.7(What's the best way to handle multi select parameters in BIRT 3.7 ?)
Best way to handle multi select parameter in BIRT 3.7 [message #772065] Wed, 28 December 2011 23:10 Go to next message
Alessio Pollero is currently offline Alessio PolleroFriend
Messages: 66
Registered: August 2011
Member
I have a report that have a parameter that is a list that allow multiple item selection, How can i bind the multi select parameter to the query text ?

I have to send the parameter from the engine(API), how can i send the value for this kind of parameter ? Do i have to send an array of string or i have to send the values separated by comma ?
Re: Best way to handle multi select parameter in BIRT 3.7 [message #774288 is a reply to message #772065] Tue, 03 January 2012 16:29 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

From the api use an array with the correct data type. For example with
an integer use:

Integer parmvals[] = new Integer[3];
parmvals[0]=10104;
parmvals[0]=10105;
parmvals[1]=10106;

task.setParameterValue("parm1", parmvals);

It is best for multi-select parameters to not use a data set parameter
in the query. Just use a beforeOpen script on the dataset to modify the
query. See attached report examples.


Jason

On 12/28/2011 6:10 PM, Alessio Pollero wrote:
> I have a report that have a parameter that is a list that allow multiple
> item selection, How can i bind the multi select parameter to the query
> text ?
> I have to send the parameter from the engine(API), how can i send the
> value for this kind of parameter ? Do i have to send an array of string
> or i have to send the values separated by comma ?
Re: Best way to handle multi select parameter in BIRT 3.7 [message #821017 is a reply to message #774288] Wed, 14 March 2012 21:10 Go to previous messageGo to next message
Lynne Cooley is currently offline Lynne CooleyFriend
Messages: 3
Registered: March 2012
Junior Member
Hello Jason,

So if you were running this report as a command line with genReport how can the parameter "parmorders" be passed in?

genReport -p "parmorders=[112,114]" ?

and does this work with dynamic list length also?

-p "parmorders=[112,114,210,330]"

or would it be better to just define the paramter as a string with special characters such as "parmorders=112|114|210|220" then parse in the beforeOpen script on the dataset to modify the query?

Thank you, Lynne
Re: Best way to handle multi select parameter in BIRT 3.7 [message #821057 is a reply to message #821017] Wed, 14 March 2012 22:01 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

In the viewer you just repeat the parameter name ie
&myParmeter=value1&myParameter=value2
I have not tried this with genReport.

Jason

On 3/14/2012 5:10 PM, Lynne Cooley wrote:
> Hello Jason,
> So if you were running this report as a command line with genReport how
> can the parameter "parmorders" be passed in?
> genReport -p "parmorders=[112,114]" ?
> and does this work with dynamic list length also?
>
> -p "parmorders=[112,114,210,330]"
>
> or would it be better to just define the paramter as a string with
> special characters such as "parmorders=112|114|210|220" then parse in
> the beforeOpen script on the dataset to modify the query?
>
> Thank you, Lynne
Previous Topic:Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc
Next Topic:What's New - 3.7.2
Goto Forum:
  


Current Time: Tue Dec 23 03:52:57 GMT 2014

Powered by FUDForum. Page generated in 0.02110 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software