Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to manipulate certain values from a multi-value parameter
How to manipulate certain values from a multi-value parameter [message #1713398] Tue, 03 November 2015 18:44
Scott Williams is currently offline Scott WilliamsFriend
Messages: 10
Registered: March 2014
Junior Member
Previously, I needed help searching on multiple values whenever a certain value was selected in a parameter. Somebody here helped me by suggesting I put the following in the data set query:

and WO_CATEGORY in ('xyz')


and then the following in the beforeOpen script for that data set:

if (params["Categories"].value == 'F-MAC')
{this.queryText = this.queryText.replace("'xyz'","'F-MAC','C-CDB','F-FMB','M-MAC'")}
else if (params["Categories"].value == 'F-DAMAGE')  
{this.queryText = this.queryText.replace("'xyz'","'F-DAMAGE','M-DAMAGE'")}
else if (params["Categories"].value == 'F-DISASTER')  
{this.queryText = this.queryText.replace("'xyz'","'F-DISASTER','M-DISASTER'")}
else if (params["Categories"].value == 'F-PMB')  
{this.queryText = this.queryText.replace("'xyz'","'F-PMB','M-PMB'")}


This worked perfectly and did exactly what I needed it too. Now, I'm working on a new report that's a little different. It also has a "Categories" parameter, except this time, Categories is a multi-value parameter. In other reports with a multi-value parameter, I use the following beforeOpen script:

if (params["Categories"].value != 'ALL')
{this.queryText = this.queryText.replace("abc", params["Categories"].value.join("','"));}


My understanding is that this script joins all values selected into 1 string, separated by commas, unless "ALL" is selected.

What I would like to do is combine both of these concepts. I need the user to be able to select multiple values from the Categories parameter, but whenever certain categories are selected, I need it to search for multiple other values as well. For example, let's say F-CIP and F-MAC were selected. F-CIP does not have any alternate values that need to be searched on, but F-MAC does (C-CDB, F-FMB, and M-MAC). In this example I would need the script to change 'F-MAC' to 'F-MAC','C-CDB','F-FMB','M-MAC', join it with 'F-CIP', and return that entire string to the data set query to search on all of those values. Is this possible?

I'm thinking I would need to first check the values in the parameter and if any match the cases I referenced above, go ahead and replace them with the alternate values. Then, once that is complete, join all of the strings. Does that logic seem sound? If so, any guidance on how to do the first part would be appreciated. Thank you.
Previous Topic:How to reference the string of a multi-value parameter
Next Topic:Expression text for mongo aggregate query in BIRT
Goto Forum:
  


Current Time: Fri Apr 26 03:38:11 GMT 2024

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

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

Back to the top