eldire Posted March 10, 2010 Share Posted March 10, 2010 so that a report when recovering the date shows the months to me in English, in spite of to have selected in locale the Spanish If I execute the SQL in oracle is no problem, but I have problems from jasperserver I have proven the same report in another machine with jasperserver 3,1 and against the same oracle and works well. Some Idea?. Jasperserver 3.5 oracle 11G Sorry for my bad English but this translation I have done it with Babel fish Link to comment Share on other sites More sharing options...
mdahlman Posted March 10, 2010 Share Posted March 10, 2010 eldire,iReport makes it easy to set a date format in a date field. This is useful in many cases. You do not want this, because it will hard-code the format.To get a date to display correctly in a locale-dependent way create a text field like this:DateFormat.getDateInstance(DateFormat.SHORT, $P{REPORT_LOCALE}).format( $F{MyDateField} )That converts a java.util.Date into a String representation of the date and takes the locale into account.Regards,Matt Link to comment Share on other sites More sharing options...
eldire Posted March 11, 2010 Author Share Posted March 11, 2010 I feel I believe it that I have not explained myself well, the problem is that I use a consultation that uses sysdate to obtain the date of the system, which I put on the foot of the report. I do if it in oracle gives back Marzo to me, I do but it in Jasperserver gives back March to me. What can be the problem? It can be the operating system. Link to comment Share on other sites More sharing options...
mdahlman Posted March 11, 2010 Share Posted March 11, 2010 eldire,If you use "sysdate()" in an Oracle query it does not return "Marzo". It returns a date object. (This is probably represented internally as a number of milliseconds since the epoch... but that detail is not important.) The default way of formatting this date depends on various settings. So because of your server settings and your client settings you see "Marzo".JasperServer receives this same date object. Because of certain settings you are seeing this date object get formatted to "March".But it's possible to tell the report to format this date object differently. Did you try the sample code I posted?Regards,Matt Link to comment Share on other sites More sharing options...
hozawa Posted September 12, 2014 Share Posted September 12, 2014 This is an old thread but for anyone else with a similar problem, the problem is with the locale in the application server.In Tomcat, set -Duser.language=ja -Duser.country=JP in the setenv.bat file.set JAVA_OPTS=%JAVA_OPTS% -Duser.language=ja -Duser.country=JPE.g. 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