How do I get the Logged In User's Name in Jaspersoft Studio?

I need to filter input controls based on the logged in user name. iReport 5.1 had Domain Parameters which could be added to the Report. How do I accomplish this in Jaspersoft Studio?

Thank you.

sonuverghese's picture
Joined: May 29 2013 - 11:34am
Last seen: 2 years 5 months ago

2 Answers:

When you are using JasperSoft Studio, you dont have to use credentials to open the studio, so, there is no actually loggedin user. There is a logged in user when you are working with the server, either as a user, in the web UI or as a developper from JSS, with the repository plugin. So, there can not be a loggedin user when JSS executes a report in its preview tab.

You can add a String parameter to your report, named exactly LoggedInUsername and this parameter will be automatically populated by JasperReports Server when the user will execute it from the server from the web UI..

If you publish the report to the server and ask (from JSS) the server to execute it, the server will receive this inquiry from an authenticated connection (JSS repository plugin needs credentials), it will populate the parameter with the username configured in the JSS repository plugin. 

fcerbell's picture
712
Joined: Aug 14 2011 - 1:00pm
Last seen: 8 years 2 months ago

Thank you.

sonuverghese - 9 years 3 weeks ago
hozawa's picture
170147
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 9 months ago
Feedback
randomness