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

passing current user id in BIRT report parameter

Hi,

Is there any way to pass current user id in report parameter?
For example, I would like to create parameter type string, and with javascript get current user id in default value.
I tried with adding '{Current Contributor}' in js variable, but it doesn't work.

0 votes



3 answers

Permanent link
You will need to create a data set that use the COMMON_SNAPSHOT.CONTRIBUTOR table. Pass the '{Current Contributor}' value as a parameter data set, then have the data set give you back the contributor name (or whatever you need back). You can bind the data set to a hidden dynamic text element and store the result in a global javascript variable that you can user later.

0 votes


Permanent link
You will need to create a data set that use the COMMON_SNAPSHOT.CONTRIBUTOR table. Pass the '{Current Contributor}' value as a parameter data set, then have the data set give you back the contributor name (or whatever you need back). You can bind the data set to a hidden dynamic text element and store the result in a global javascript variable that you can user later.


Hi Rafik,

I tried this method, but still doesn't work.
I used table VARIABLE from REPORTS snapshot, and passed the '{Current Contributor}' as PARAMETER. On initialize method I created global variable. then, I created a Dynamic Text field which I binded to data set VARIABLE, and in Dynamic Text field I wrote this:
globVar = row;
I can get this anywhere after I run report, but my question is would it be possible to get current user before report starts, that is, to get it as default value in report parameter input pick list...

Hope you understood my question.

Thanks,

0 votes


Permanent link
You will need to create a data set that use the COMMON_SNAPSHOT.CONTRIBUTOR table. Pass the '{Current Contributor}' value as a parameter data set, then have the data set give you back the contributor name (or whatever you need back). You can bind the data set to a hidden dynamic text element and store the result in a global javascript variable that you can user later.


Hi Rafik,

I tried this method, but still doesn't work.
I used table VARIABLE from REPORTS snapshot, and passed the '{Current Contributor}' as PARAMETER. On initialize method I created global variable. then, I created a Dynamic Text field which I binded to data set VARIABLE, and in Dynamic Text field I wrote this:
globVar = row;
I can get this anywhere after I run report, but my question is would it be possible to get current user before report starts, that is, to get it as default value in report parameter input pick list...

Hope you understood my question.

Thanks,

Hi Rafik,

I tried with the current date in default value parameter:

var currDate = new Date();
currDate;

This works on preview tab, but doesn't work when you deploy report design. It is treated like a "string".
Even if I find the method for my situation, I am not sure how it will be treated.

Regards,

0 votes

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

Question asked: Dec 12 '11, 10:42 a.m.

Question was seen: 7,501 times

Last updated: Dec 12 '11, 10:42 a.m.

Confirmation Cancel Confirm