How to split BIRT parameter values
Hi,
I am using BIRT 2.6.2 version. I am using cascading parameter and have three parameters to pass. Project area, Timeline and Iteration. Iteration is multi-selection. I need the ITERATION_ITEMID to be used in Javascript for data processing. But I am unable to get the multi-selected ITERATION_ITEMIDs. It is giving result as a single string with quotes (') and each ITERATION_ITEMID separated with commas (,). I am able to remove the quotes based on https://jazz.net/forum/questions/90236/how-to-enable-multi-select-parameters-in-birt-for-rtc-reporting . But still struggling to split the multiple ITERATION_ITEMIDs separated by comma. As mentioned in the link I used split, but giving some junk value. Basically I need to check the work item record against each ITERATION_ITEMID and if it matches I need to process. Any help on this is highly appreciated.
One answer
Hi Tojan,
I think I had a similar issue in my case the name of the parameter was "GEO":
Best regards,
Tad
I think I had a similar issue in my case the name of the parameter was "GEO":
importPackage(Packages.java.util.*);
geosSet = new java.util.HashSet();
try {
geosTable = params["GEO"].value.replace(/'/g,"").split(",");
} catch (err) {
if ((params["GEO"].value.getClass().getName()) == "[Ljava.lang.Object;") {
geosTable = params["GEO"].value;
} else {
geosTable = params["GEO"].value.replace(/'/g,"").split(",");
}
}
// print the results
for (i=0; i < geosTable.length;i++) {
geosSet.add(geosTable[i]);
// Set the GEO label header
if(i > 0)
_GEO += " & ";
_GEO += enums["Region"][geosTable[i]];
}
BTW what do you mean by "junk value"?
Best regards,
Tad