Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to reference the string of a multi-value parameter
How to reference the string of a multi-value parameter [message #1713092] Fri, 30 October 2015 20:38 Go to next message
Scott Williams is currently offline Scott WilliamsFriend
Messages: 10
Registered: March 2014
Junior Member
I'm working on a report that has a different title depending on which parameter is selected. I need to add a new condition that will display a unique title if specific values are selected from TWO different parameters. Here's what I have:

<VALUE-OF>if (params["Categories"] == "F-MAC" and params["WorkCodes"] != "ALL")
{
	"Furniture and Design"
}
else
{
	if (params["Categories"] == "F-MAC") 
	{
		"Move-Add-Change"
	}
	else 
	{
		if (params["Categories"] == "F-DAMAGE")
		{
			"Damage"
		}
		else
		{
			if (params["Categories"] == "F-DISASTER") 
			{
				"Disaster"
			}
			else
			{
            	if (params["Categories"] == "F-PMB")
             	{
                	"Preventive Maintenance"
             	}
        	}
        }
	}
}
</VALUE-OF> Billing Report


The first line is the one I'm having the problem with. The "!= All" is just a placeholder. What I actually want to do is use "Furniture and Design" as the title when "F-MAC" is selected as the Category and both DESIGN and FURN are selected for the multi-value parameter WorkCodes.

I guess my question is, how would I code that? What exactly would the value of params["WorkCodes"] look like when both DESIGN and FURN are selected? Would it be "DESIGN,FURN"? Something else? Or is it not even possible to do this?

Also, for some reason it's not even working when I try != "All". Can you not reference two params in the same line like that? Or did I mess something up somewhere? Any help would be appreciated.
Re: How to reference the string of a multi-value parameter [message #1713226 is a reply to message #1713092] Mon, 02 November 2015 14:43 Go to previous messageGo to next message
Scott Williams is currently offline Scott WilliamsFriend
Messages: 10
Registered: March 2014
Junior Member
Figured out why I was getting an error, replaced and with &&.

I'm still not sure how to check the WorkCodes parameter to see if both DESIGN and FURN were selected. Any help would be appreciated.
Re: How to reference the string of a multi-value parameter [message #1713396 is a reply to message #1713226] Tue, 03 November 2015 18:41 Go to previous message
Scott Williams is currently offline Scott WilliamsFriend
Messages: 10
Registered: March 2014
Junior Member
In case anybody else finds this thread and is curious, I was able to accomplish this with the following script:

if (params["Categories"] == "F-MAC" && 
	params["WorkCodes"].toString().indexOf("DESIGN")>-1 &&
	params["WorkCodes"].toString().indexOf("FURN")>-1)
{
	"Furniture and Design Billing Report"

}
Previous Topic:Maps Component
Next Topic:How to manipulate certain values from a multi-value parameter
Goto Forum:
  


Current Time: Fri Apr 26 07:56:37 GMT 2024

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

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

Back to the top