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

How to do String comparison in condition ?


johann60280

Recommended Posts

Hello everyone!!

I have an issue in my jasper report.I have a parameter ($P{Mois}) which give me data like this "201901, 201902, 201903, etc" from my input control

I try to display a month with a condition like this:

($V{month} == "01")? "Janvier "+$P{Mois}.substring(0,4) : "test"[/code]

But he give me "test" whereas I selected the good month in my input control.

My variable month contains this:

$P{Mois}.substring($P{Mois}.length()-2) //this give me the month like "01, 02, 03, etc"[/code]

Someone have an idea of my problem ? Because I don't found the solution. If someone can help me it will be great!

Thank in advance.

 

 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

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