Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Cannot find function match
cmrdjr
This worked at one time and now it cannot find this function. Not sure what has changed. Any help would be greatly appreciated.
Thanks
Find more posts tagged with
Comments
mwilliams
Hi cmrdjr,
Just a couple questions to help me understand what you're looking for:
Where are you trying to use this function?
-AND-
What are you using this function for?
cmrdjr
Basically, we have a web application that will send a comma separated list to the BIRT report viewer. I need to parse this string on the commas and then surround the values with single quotes so that it may be used in the sql as an in ('value','value2') string. This worked at one time and in fact works in a co-workers installation. I have upgraded to the latest version of Eclipse and BIRT where my co-worker has not, but last week this code worked fine in my version of Eclipse/BIRT.
I have this code in the beforeOpen script for the dataset.
Here is my code:
if (params["FIN_COA_CD"].match(","))
{
var parms = params["FIN_COA_CD"].value.split(",");
for (i=0; chart in parms; i++ )
{
if (i==0 ) {
chartClause = "'" + parms[chart] + "' " ;
}
else {
chartClause = chartClause + ", '" + parms[chart] + "'" ;
};
};
} else {
chartClause = "'" + params["FIN_COA_CD"] + "'";
};
cmrdjr
The error message from BIRT was not helpful in resolving this matter. The issue turned out to be the for loop condition set. I had to change the for loop from for (i=0; chart in parms; i++ ) to for (i=0; i < parms.length; i++ ). Apparently if you use chart in parms you don't need the integer counter as it will loop through all the values in the array on it's own.
mwilliams
cmrdjr,
So, this worked for you at one time in BIRT 2.3, but now it no longer does? or it worked in the previous version and stopped working when you upgraded?
cmrdjr
No, I needed to use the counter value in an if so I tried to use the counter in the for loop while keeping the syntax of the "parm in array". that did not work and the error message was not helpful in resolving this issue.
mwilliams
cmrdjr,
Just replied and then saw that you posted that you had figured it out. I had been unable to duplicate the problem, that's why I asked the questions I asked. Glad you found a solution.