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

user defined parameters


jadavis

Recommended Posts

Does anyone know of a way to set user defined parameters in Jasper Server? And then in turn use those parameters in Ireport, so we don't have to generate mutliple reports for different users.

For example:  if I have two users (USR1 and USR2 defined in JasperServer) and they both have access to a specific report, I would like the report to be intelligent enough to know what user is requesting the information and only return the rows of the data that are specific to them.

select * from employee_data where employee = (should be usr1 or usr2)

Any ideas?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

jadavis,

 

In JasperServer Professional the standard way to solve this is using Data Domains. They include row-level security to do what you're describing.

 

Alternatively, in JasperServer Pro or in JasperServer Community Edition you can use the built-in parameter $P{LoggedInUser}. There is an example shipped with JasperServer that shows this parameter in action: /reports/samples/SalesByMonth. The shipped example merely displays some info from the parameter, but you could easily use it to parameterize the SQL query as well.

 

More details are covered in several threads in the JasperServer forum. This thread may be the most useful for what you're doing.

 

Regards,
Matt

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