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

0

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: 3 years 10 months ago

2 Answers:

3

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
264
Joined: Aug 14 2011 - 1:00pm
Last seen: 4 years 6 months ago

Thank you.

sonuverghese - 5 years 4 months ago
0
hozawa's picture
44209
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 month 6 days ago
Feedback
randomness