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
Comments
Hi Tad,
Thanks for you help. Still I am getting same result. Iterations are appearing as "Ljava.lang.Object;@35233523" once I split.
Hi Tojan,
Are you able to share your report, *.rptdesign file?
Best regards,
Tad
Hi Tojan,
Were you able to solved this issue?
Maybe you should use ITERATION_ID or ITERATION_NAME instead of ITERATION_ITEMID and check if this issue appears?
The results you mentioned suggest, that the cast is made in a wrong way.
Are you able to share with us how does your Data Set from which you are trying to get those values look like? (what is the data source, tables, parameters you used)
Also how is your Report Parameter built?
Best regards,
Tad