Jump to content
Changes to the Jaspersoft community edition download ×

passing logged in user name dynamically to query


MohanRao

Recommended Posts

Hi,

 

Is there any way I can pass the logged in user name to the report query at run-time?

 

I have tried using $P{UserName} in a text field in the iReport, but when seen in the browser, it show null.

 

I have tried the same thing with $P{LoggedInUser} also. But it fails (gives null).

 

Thanks,

Mohan.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You could have one parameter in your report that isForPrompting that allows you to enter the user name.

 

Have an expression in the parameter you use that selects either the isForPrompting parameter or the one being set by JasperIntelligence when it is running.

 

Sherman

JasperSoft

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...