Use BuiltIn parameters in Jasper Reports
Jasper provides few builtIn parameters which can be used in JRXML.
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
Click on this link for more information
Following are few built-in parameters
-
- LoggedInUserFullName :
- Type of this parameter is ‘String’.
- This parameter gives you full name of loggedin user.
- LoggedInUsername :
- Type of this parameter is ‘String’.
- This parameter gives you user name of loggedin user.
- Example: If you want to show username and fullname of person at the bottum of your page then you can use this on your page footer
- LoggedInUserFullName :
"Last printed by " + $P{LoggedInUserFullName} + " on " + new java.util.Date()
-
- LoggedInUserTenantId :
- Type of this parameter is ‘String’. Not applicable for Community Edition.
- This is used to get organization of logged in user.
- LoggedInUserRoles :
- Type of this parameter is ‘Collection<String>’.
- This parameter gives you all roles of loggedin user.
- Example : if you want to show only reports to user who has role ‘ROLE_ADMINISTRATOR’ then you can use this in print when expression
- LoggedInUserTenantId :
($P{LoggedInUserRoles}.toString().contains("ROLE_ADMINISTRATOR")) ? new Boolean(true) : new Boolean(false)
- LoggedInUserAttribute_<attribute name> :
- Type of this parameter is ‘String’.
- This built in parameter is used to get value of specific profile attribute by passing the name of profile attribute name.
- Eample: lets say one of your profile attribute name is city and profile attribute value is Maxico.
If you want to get value of city (value Maxico) in your JRXML then do this
-> replace “_<attribute name>” to profile attribute name
ie. LoggedInUserAttribute_city
As we know, we can add comma separated value to profile attribute but we can not directly use this profile attribute in JRXML as list. In order to use comma separated profile attribute as a list in your JRXML then refer this
Convert Comma Separated Profile Attribute to list in Jasper Reports
Best Open Source Business Intelligence Software Helical Insight is Here
A Business Intelligence Framework
Subscribe
Login
1 Comment
Oldest