How to show Input Parameter in jasper report?

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

In my jasper report,I have filter input parameter called user name, user id. Using Jaspersoft Studio, how do I show those parameter on my report if the end user enters user name or user id.

On my report, I want to show following using parameters.

Filter by: User Name -Jonny User ID - 12345

IF None of those parameters is entered, none will be shown.

Plz help.

purnendub's picture
Joined: Feb 3 2015 - 10:16am
Last seen: 7 years 1 month ago

1 Answer:

You may use a java expression like the following in a textfield of your header:

(  (  null != $P{User Name }  )  ||  (  null != $P{User ID }  )  )  ?  "Filter by:" +   ( (  null != $P{User Name }  ) ? " User Name- " +  $P{User Name }  : "" ) +
( (  null != $P{User ID }  ) ? " User ID- " +  $P{User ID }  : "" )   : ""
 

mattmb's picture
43
Joined: Mar 31 2014 - 2:27am
Last seen: 7 years 2 months ago
Feedback
randomness