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

Based on user I need change the DataSource for jasper report or charts


rajasekhar_1
Go to solution Solved by darth_fader,

Recommended Posts

Dear jasper Master

                                          I am new to jasper ,  We have one jasper server and no of users and no of data sources respectively to the users .now all the reports and charts in the server need to  run /display for all users with their data . if one user connected to server with his/her  user id the data source should be him/her self , is it possible to use only one set of reports / charts useful for all users

(dynamically change the data source based on user ) what I have to do in JRXML file .or any other option ?

alredy these reports are imported from another server   is there any option available in server settings in jasper server  ?

kindly suggest on above

Thanks

Rajasekhar

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

You can add an attribute to each user in your jasperserver installation that sets a value in the JDBC connection dynamically based on user. For example, you can set properties in the jdbc connection based on those attributes. In this way you can change the datasource based on the user. Again, this is all done at the jasperserver level.

There is a reference that also accomplishes something similar via spring, but I don't think it's necessary.

http://community.jaspersoft.com/wiki/switching-datasource-based-user

 

Link to comment
Share on other sites

JasperServer starting from version 6 has an option to use profile attributes in the data source definitions. Take a look at the chapter 4.1 "Profile attributes in data source definitions" in the JasperServer Admin Guide for more information on the feature.

Another thing you can do to restrict the data based on the user logged in is to use domain data security. For that feature take a look at Chapter 5 in JasperServer Security Guide.

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