johann60280 Posted January 21, 2020 Share Posted January 21, 2020 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 controlI 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 More sharing options...
I am Leo Posted January 22, 2020 Share Posted January 22, 2020 Use .equals instead of == when comparing string. ($V{month}.equals("01")) ? "Janvier " + $P{Mois}.substring(0,4) : "test"[/code] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now