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

How to show Input Parameter in jasper report?


purnendub

Recommended Posts

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.


Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 }  : "" )   : ""
 

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