Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



One answer

Permanent link
Hi Tojan,

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

0 votes

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

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,033

Question asked: Nov 27 '14, 12:03 p.m.

Question was seen: 6,620 times

Last updated: Dec 01 '14, 6:57 a.m.

Confirmation Cancel Confirm