Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How do I get Current User ID in a BIRT report?
pauls1
Hello,
I am new to BIRT and new to javascript? I have Eclipse, BIRT Desinger, BIRT Viewer, and Tomcat running on my PC - I have not been able to get the current user ID in a report (using designer or the viewer) ? I have read several posts on this subject, the solution I am currently trying is based on a post that recommends using ?reportContext.getAppContext().get('ServerUserName')? in javascript and to assign the value to a BIRT variable. As a test, I have a script in the script window of a report repeated for different report events using different BIRT Report Variables and exposing the variables in the body of the report; they all return their default value of ?None".
Here is the script using the BIRT Report Variable uid1:
var myLoginName = reportContext.getAppContext().get('ServerUserName');
if (myLoginName!=null) {vars["uid1"]=myLoginName};
I would appreciate any help on how to get this or a different solution working.
Thanks
Find more posts tagged with
Comments
There are no comments yet