jjones_4 Posted September 9, 2016 Share Posted September 9, 2016 I need to show a date in a language defined by a locale that is stored in a string variable named "locale". new SimpleDateFormat("EEEE, MMMM d, YYYY", Locale.forLanguageTag("es-MX")).format(new Date("09/01/2016")) This code returns "jueves, septiembre 1, 2016" which is what I need. However, if I store the "es-MX" in a simple string variable and replace the hard-coded locale with the variable, it returns NULL: new SimpleDateFormat("EEEE, MMMM d, YYYY", Locale.forLanguageTag($V{locale})).format(new Date("09/01/2016")) I have also replaced the Locale.forLanguageTag("es-MX") with new Locale("es", "MX") but get the same result. Does anyone know of a way to accomplish this? Thanks, Danny Link to comment Share on other sites More sharing options...
Solution hozawa Posted September 11, 2016 Solution Share Posted September 11, 2016 Did you try using Parameters instead of Variables? Set the value to a parameter and check property of the parameter to not prompt. Link to comment Share on other sites More sharing options...
jjones_4 Posted September 12, 2016 Author Share Posted September 12, 2016 IT WORKED !!!!Thanks For The Help. I am still pretty new to Jasper. I did not know that a parameter is treated different than a variable. 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