Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
[ Interactive viewer ] get user name in the launched report
egau
Hello,<br />
<br />
I m looking for a method that I can use to get the user that is connected to the interactive viewer in my report. This will enable me to limit access to some data or not regarding to the user profile.<br />
<br />
For exemple, my user is connected as the "user1", <br />
<br />
How to retrieve "user1" in my report?<br />
<br />
I saw things like that but I m not sure that it is really what I need ( and it doesn't work for now anyway, I only get "null" )<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>function getLoggedInUsername() {
var myLoginName = null;
var request = reportContext.getHttpServletRequest();
if (request!=null) {
if (request.getRemoteUser()!=null) {
myLoginName = request.getRemoteUser();
}
}
return myLoginName;
}</pre>
<br />
Thanks in advance.<br />
<br />
Regards,
Find more posts tagged with
Comments
rmurphy
If you are looking to get the user name during report generation (i.e. server side), the you should call reportContext.getAppContext().get("ServerUserName") in your report script.
If you are looking to get the user name client side, call getUserId() on the actuate JavaScript object.
egau
<blockquote class='ipsBlockquote' data-author="'rmurphy'" data-cid="116349" data-time="1367252313" data-date="29 April 2013 - 09:18 AM"><p>
If you are looking to get the user name during report generation (i.e. server side), the you should call reportContext.getAppContext().get("ServerUserName") in your report script.<br />
<br />
If you are looking to get the user name client side, call getUserId() on the actuate JavaScript object.<br /></p></blockquote>
<br />
<br />
Perfect ! <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>reportContext.getAppContext().get("ServerUserName")</pre>
<br />
Exactly what I was looking for.<br />
<br />
Thanks !
DenisG
<p>Hello, guys! Does anyone could provide example how to use reportContext.getAppContext().get("ServerUserName") in report script?</p>
<p>I just add this (reportContext.getAppContext().get("ServerUserName")) to data element and see nothing in output instead of username. Using BirtViewer with OpenText on TOMCAT.</p>
Clement Wong
<p>Pierre has been addressing your question in this thread
@<
;/p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/34430-display-username-that-execute-the-report/?p=140831'>http://developer.actuate.com/community/forum/index.php?/topic/34430-display-username-that-execute-the-report/?p=140831</a></p>
;