Logged In User Paramenter

Goal: Have dashboards that are specific to Location or User.

We have three retail branches. Each branch has several retail users.

I would like to create various dashboard reports which may show either the Branch data, or the User data, depending upon the report. 

Our Jaspersoft implementation is integrated into another program. From which there are only two User accounts ( 1- jasperadmin and 2 - readOnlyUser).


Because of this configuration, I presume, and am seeking confirmation, that I can not get the retail user name to drive the report / chart / dashboard, because all users are seen as 'readOnlyUser'.

Question A - is this a correct presumption? 


Question B - Am I thinking correctly with the following: 

If I want to be able to create such reports / charts / dashboards, the first step is to create indiviual accounts using the 'Add User...' 

Then add specific Parameters to the Reports I build.


While the User properties in Jasersoft does not seem to provide a 'Branch' field, I think I could accomplish by grouping users in various queries. 


Any other suggestions or guideposts? 


Thanks in advance.


mike.atkinson's picture
Joined: Aug 25 2020 - 5:26am
Last seen: 1 month 2 weeks ago

For anyone who trips over this old post: 

First, I had to create users in Jaspersoft.  I could not do this with the 'readOnlyUser' (as I expected). With individual users created, I was able to use the reserved word parameter  LoggedInUsername  to populate report data. This required creating the parameter in the report, and the table dataset, and linking them together. Then I can use the parameter in the report query ( $P{LoggedInUsername} ) to retrieve user specific information for the report.

I am not working on GROUPing individual user results together.

To accomplish this, I first created a User Attribute for Branch, in which our various Branches will be stored for each user.

It appears there is a reserved word : Attribute_Branch, which I should be able to use in a similar manner to LoggedInUsername. (There is also a LoggedInUsernameAttribute reserved word).

The challenge now is how to read the User Attribute from the Jaspersoft program. I do not have Jasper itself as a Data Source, so I think I'm stuck there, at the moment.

mike.atkinson - 1 year 9 months ago

1 Answer:

Users can have custom attributes such as branch that can be fed into the report.

Your application has user, I wonder if you could feed this as a parameter into the report.


In the meantime:

A simple temp solution would be to set a branch parameter that is not visible with a default setting.  Make 3 copies of the report / one for each branch.  

Give each a long uniqe random name so each has its own unique URL you could pass out as seperate dashboards.


When you make a change to the report copy it to the other 2 and set the default branch.

(Temp until you figure out how to pass the user or want to setup seperate branch logins)

danoldenkamp@gmail.com's picture
Joined: Aug 29 2018 - 11:12am
Last seen: 2 years 6 months ago