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

Meaningful Parameters and Variables


sdemills

Recommended Posts

I wish to display my parameters in a meaningful way but also need codified values to get the SQL to work.

Here's an example: the parameter passed to the report might say "cpMargin" but I might want it to say "Margin %" in the report title.

So I have tried setting a Variable and using it in the report title, like this...

(Variable set to) new String($P{pSequence}.equalsIgnoreCase( "cpMargin" ) ? "Margin%" : ($P{pSequence}.equalsIgnoreCase( "cMargin" ) ? "Margin" : ($P{pSequence}.equalsIgnoreCase( "sMinutes" ) ? "Volume" : "Product")))

What this is supposed to do is to choose one of 4 values depending on what the parameter is.

This compiles and executes but always shows as "null".

How can I make this work.

There is a workaround of course: my driving Java program can pass two parameters - one to be displayed and one to be used in the SQL but I'd like to know more about parameters and variables and how to get them to work how I need them to.Kind

Regards
Steve

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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