multiple listbox parameter trouble [message #497959] |
Fri, 13 November 2009 10:02  |
Eclipse User |
|
|
|
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.
|
|
|
|
Re: multiple listbox parameter trouble [message #498015 is a reply to message #497959] |
Fri, 13 November 2009 12:06  |
Eclipse User |
|
|
|
thanks for the reply jason, I figured it out on my own, for anyone who is interested here is my solution, works perfectly!
ExhaustLocationsTable = reportContext.getReportRunnable().designHandle.getDesignHand le().findElement( "exhaustLocations");
NoRestockLocationsTable = reportContext.getReportRunnable().designHandle.getDesignHand le().findElement( "noRestockLocations");
DynamicLocationsTable = reportContext.getReportRunnable().designHandle.getDesignHand le().findElement( "dynamicLocations");
var size = params["rprmTable"].value.length;
var items = '';
for(var i = 0; i < size; i++)
{
if(params["rprmTable"].value[i] == "Exhaust Locations")
items += '1,';
else if(params["rprmTable"].value[i] == "No Restock Locations")
items += '2,';
else if(params["rprmTable"].value[i] == "Dynamic Locations")
items += '3,';
}
var parts = items.split(",");
if((parts.length - 1) == 1)
{
if(parts[0] == '1')
{
NoRestockLocationsTable.drop();
DynamicLocationsTable.drop();
}
else if(parts[0] == '2')
{
ExhaustLocationsTable.drop();
DynamicLocationsTable.drop();
}
else if(parts[0] == '3')
{
NoRestockLocationsTable.drop();
ExhaustLocationsTable.drop();
}
}
else if((parts.length - 1) == 2)
{
if((parts[0] == '1' || parts[1] == '1') && (parts[0] == '2' || parts[1] == '2'))
DynamicLocationsTable.drop();
else if((parts[0] == '2' || parts[1] == '2') && (parts[0] == '3' || parts[1] == '3'))
ExhaustLocationsTable.drop();
else if((parts[0] == '3' || parts[1] == '3') && (parts[0] == '1' || parts[1] == '1'))
NoRestockLocationsTable.drop();
}
|
|
|
Powered by
FUDForum. Page generated in 0.03875 seconds