|
Re: multiple listbox parameter trouble [message #497996 is a reply to message #497959] |
Fri, 13 November 2009 16:07 |
|
You are on the right track, you just need to iterate over the parameter
choices.
var keepExhaust = false;
var parmcount = params["rprmTable"].value.length
for( i=0; i < parmcount; i++ ){
//either switch on the parameter or if else
//to get the parameter value use
//params["rprmTable"].value[i]
if( params["rprmTable"].value[i] == "Exhaust Locations" ){
keepExhaust = true;
}
}
//now do the drops
if( !keepExhaust ){
ExhaustLocationsTable.drop();
}
//do the same for all the other tables
Also you can use repoortContext.getDesignHandle().findElement() now.
Jason
juan436585@yahoo.com wrote:
> Hi, im pretty new to BIRT so maybe somebody here can help me out.
> I want it so that when the parameters prompt comes up for my report, a
> user can choose one or more tables to view from a listbox and whichever
> ones are not selected are not viewed on the report. So my report
> currently has three data sets and three tables (one for each).
> I had it working when it was a single value drop down box, but it
> doesn't work when i enable multiple values. I am using a report
> parameter and a script on beforeFactory to do all this. Here is the script:
>
> ExhaustLocationsTable =
> reportContext.getReportRunnable().designHandle.getDesignHand
> le().findElement( "exhaustLocations");
> NoRestockLocationsTable =
> reportContext.getReportRunnable().designHandle.getDesignHand
> le().findElement( "noRestockLocations");
> DynamicLocationsTable =
> reportContext.getReportRunnable().designHandle.getDesignHand
> le().findElement( "dynamicLocations");
>
> if (params["rprmTable"].selected == "Exhaust Locations")
> {
> NoRestockLocationsTable.drop();
> DynamicLocationsTable.drop();
> }
> else if (params["rprmTable"].selected == "No Restock Locations")
> {
> ExhaustLocationsTable.drop();
> DynamicLocationsTable.drop();
> }
> else if (params["rprmTable"].selected == "Dynamic Locations")
> {
> ExhaustLocationsTable.drop();
> NoRestockLocationsTable.drop();
> }
> else if (params["rprmTable"].selected == "Exhaust Locations" && "No
> Restock Locations")
> {
> DynamicLocationsTable.drop();
> }
> else if (params["rprmTable"].selected == "Exhaust Locations" && "Dynamic
> Locations")
> {
> NoRestockLocationsTable.drop();
> }
> else if (params["rprmTable"].selected == "No Restock Locations" &&
> "Dynamic Locations")
> {
> ExhaustLocationsTable.drop();
> }
>
> Am i on the right track? Any help is apppreciated.
> Note: I already tried .value, doesnt work either.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02205 seconds