Jump to content

Conditional IF/ELSE


gholamian

Recommended Posts

I have the following as my report Input Control:

Duration:1,2,3

Following parameters:

  1. startdate
  2. enddate
  3. Terms(Duration)

startdate parameter: Parameter.Class: java.util.Calendar

($P{Terms}.equals(1) ? ($P{today}.add(Calendar.MONTH, -1) || $P{today}.set(Calendar.DAY_OF_MONTH, 1)):($P{Terms}.equals(2) ? ($P{today}.add(Calendar.MONTH, -2) || $P{today}.set(Calendar.DAY_OF_MONTH, 1)):($P{Terms}.equals(3) ? ($P{today}.add(Calendar.MONTH, -3) || $P{today}.set(Calendar.DAY_OF_MONTH, 1)):$P{today}.getTime() )))[/code]

enddate parameter: Parameter.Class: java.util.Calendar

($P{today}.set(Calendar.DAY_OF_MONTH, 1))? null : $P{today}.getTime()[/code]

today parameter: Parameter.Class: java.util.Calendar - Calendar.getInstance()

terms parameter: Parameter.Class: java.lang.Number

I can see the $P{Terms} value passed to report itself. However the startdate parameter returns empty which means the value of $P{Terms} is not passing on to startdate parameter. Is it even possible to pass a value of list/parameter to another parameter?

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