Jump to content

Recommended Posts

Posted

Hello,

in Jaspersoft I create a variable of type string that do a simple operation inside a tenary code.

($P{Param1}.length() == 0) ? $V{var_x} : $V{var_x}.length() == 6 ? $V{var_x} + $P{Param2}.toString() : "Error"[/code]

In this case var_x represents a string like "01.01.". If true var_x should be concatinated with an int value like 1971.

But the return value of the variable is always null. Because I'am new to JasperReports and Jaspersoft I'am not sure if this is a setting inside the software or if the ternary operator is not valid in Jaspersoft.

Did someone have a hint for me?

Kind regards

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

A couple of things to check:

- Make sure the Variable has an "Initial Value Expression" set, or that the Variable :var_x" is populated before the above expression is executed.

- Check the "Evaluation Time" of when the variable is used.

Confirm the other properties around the Variable.

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