Jump to content
We've recently updated our Privacy Statement, available here ×

pass login name as parameter to jasper report


ernestcl

Recommended Posts

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

Hi!

One of the JS samples does this ... SalesByMonth.

Accesses $P{LoggedInUser}.getFullName().

LoggedInUser is defined as a com.jaspersoft.jasperserver.api.metadata.user.domain.User, "Use in prompt".

 

There is no corresponding input control; thus, I presume JS just knows from the class type what to assign to it?

 

Yours,

Sebastian

Link to comment
Share on other sites

  • 5 months later...

Hi,

 

Can someone show me a way to pass this parameter to the report query? I mean that my query should include JasperServer login name automatically without user promt. Thank you!

 

PS. BTW is this feature supported in the JS GPL version?

 

=========

 

Ok, now I've got it to work.

Post edited by: koskisa, at: 2007/09/04 11:42

Link to comment
Share on other sites

Hi,

 

I have implemented a modification that allows to pass j_username/j_password parameter as part of the URL (in my case I use only a j_username)

 

You may need to hook Acegi security by writing your own AuthenticationProcessingFilterEntryPoint.

It is desirable that you become familiarised with this framework before - see http://www.acegisecurity.org/suggested.html

 

A valid approach would be to check in the commence function whether these parameters are present in the URL and, if positive, redirecting to the j_acegi_security_check.

 

Hope this helps...

Link to comment
Share on other sites

koskisa wrote:

Hi,

Can someone show me a way to pass this parameter to the report query? I mean that my query should include JasperServer login name automatically without user promt. Thank you!

PS. BTW is this feature supported in the JS GPL version?

=========

Ok, now I've got it to work.<br><br>Post edited by: koskisa, at: 2007/09/04 11:42

 

I am facing the same problem and was not be able to solve it. Would you mind sharing some of your experience on how to solve it? Thanks.

Link to comment
Share on other sites

Hi,

 

You'll need to deploy you own AuthenticationProcessingFilterEntryPoint and arrange the acegi security configuration to support this.

I don't have much time but I'll try to point the basic steps involved. I'll attach some code so that you can explore it on your own.

 

The basic steps are:

- Develop you own entry point (I've attached an example)

- Create a jar file which should be included in JasperServer's WEBINFlib directory.

- Modify the applicationContext-security.xml file to:

+ Redirect the authenticationProcessingFilterEntryPoint class to your implementation

<bean id="authenticationProcessingFilterEntryPoint" class="Your class here">

+ Ensure you have an inMemoryDaoImpl as Dao authentication provider. This will allow you to define users in a list.

 

I would say these are the steps required...Unfortunately, I did this modification some time ago and I don't have enough time to revise it thoroughly.

I hope this provide you the basic guidelines to solve your problem.

 

Best regards, [file name=code.zip size=8924]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/code.zip[/file]

Link to comment
Share on other sites

  • 3 months later...

Hi,

 

This is not yet supported.

There is a built-in parameter to get a hold of the user name, but queries for input controls cannot have parameters.

 

Please post this as a feature request here:

http://jasperforge.org/sf/tracker/do/listArtifacts/projects.jasperserver/tracker.feature_requests

and we'll try include it in upcoming releases.

 

Thank you,

Teodor

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...