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

Show Parameter Name, not its value?


mwarner_2

Recommended Posts

Maybe this is real simple, but I don't know how.

 

I want to show in a text field the name of the parameter, not its value.  Something like:

Selected [parameter name]: [parameter value]

example:
Selected City:  Athens

 

So the text field would be something like "Selected " + $P{City}.name + ": "  + $P{City}

But I don't know how to do the parameter name part of this.

I want to do this so that if I change the Parameter Name, then it is automatically updated in the report (versus if I manually typed the parameter name into the text field).

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

How are you going to distinguish between several parameters? That is, if you have $P{City} and $P{Town}, and you decided to change $P{City} to $P{State}, how do you expect JasperReport to know that you've change ${{City} and not $P{Town} to ${State}?

If you just want to display name, you can just create 2 parameters - one for name and one for value.

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