Can Jasper do this?


I want to have the same report for different users but with 2 different parametres in the query depending on the user loged on.

To make it more clear, the different parametres from the query are the client and the date. Using this I want to show all the transactions this client did on the specified date. Thing is that I have 1000 clients and I can't make a different report for each user. We should have the same report for everyone with the parameters changing depending on the client logged in.



danfergarc's picture
Joined: Mar 14 2016 - 4:06am
Last seen: 7 years 1 month ago

2 Answers:

JasperServer has a functionality of retirieving the logged in username.
Just create a parameter as $P{LoggedInUsername} . This parameter retrieves the logged in username used and you can create a conditional parameter using this value.

Read this link to know more about Conditional Parameters.

Hope this helps,

kkriplani's picture
Joined: Sep 4 2015 - 2:18am
Last seen: 1 year 5 months ago

Are you using JasperReports Server or your own application?  Be careful -- if you want to keep the information confidential between clients, a simple parameter is probably not enough. A user can see the URL and remove the parameter.  It depends on the type of information you are displaying.

In the commercial version of JRS, you can use Domain security, which lets you set up a Domain in a way that securely restricts access to information from the database, so a user can only see their information.  It's a lot more complicated, but it means that users' data is secure. This only works with Domain reports.

elizam's picture
Joined: Mar 5 2012 - 9:19am
Last seen: 3 years 1 month ago