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

how customize input controls language and messages in jasperreports 4.7.1


pioppogatto

Recommended Posts

Hallo,

I need your help in order to customize some default values in JasperReports 4.7.

1)how to change data pattern for the main input control? I've put dd/MM/yyyy in the pattern  data type details but it doesn't work as when I run the report date are with yyyy-MM-dd format

2) I would also know if it's possible to change the default languages of JasperReports and to do it

3) Id like to knoe if it's possible to change messages for input controls. Ex. when I have an input controls that is mandatory, there's this message 'This field is mandatory so you must enter data.' I would like to change it, how can I do?

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

I assume you mean not JasperReports 4.7.1 but JasperReports Server 4.7.1, because JasperReports library doesn't have input controls. So I'll answer your questions for JasperReports Server 4.7.1.

1) In order to change pattern of the date input control in JRS 4.7.1 you need to edit file "../WEB-INF/bundles/jasperserver_config.properties" (default one or "_de", "_fr" etc., depending on your locale) and change "calendar.date.format" property.

2) What exactly do you mean by changing default languages? JRS 4.7.1 by default supports few locales, for which all messages are translated. You can select needed locale on login page. If you want to add new locale to the JRS 4.7.1, please check out JasperReports Server Administrator Guide - Appendix C Localization, please pay attention to C.6 JasperBabylon.

3) In order to change default messages you need to edit propeties files in directory "../WEB-INF/bundles". In order to find needed key, search for message inside each file in this directory (you can easily do it using some file manager). For example, search for message "This field is mandatory so you must enter data" and you find that it's a key "fillParameters.error.mandatoryField" in file "../WEB-INF/bundles/jasperserver_messages.properties".

Hope this helps, 

Anton.

Link to comment
Share on other sites

Hi, Anton. Thank's a lot. Yas  I meant JasperReports Server 4.7.1.

Answer n°1: do I stop and restart apache-tomcat in order to have the new file working?

Answer n°2: I mean that my log-in homepage is already translated in italian (not everything actually) but error messages are in english and also calendar date are in english format. I would llike to have everything in italian languages ... maybe messages are not translated anyhow I'll go to see the Appendix, I will let you know.

Thanks a lot

Anotnio

Link to comment
Share on other sites

Hi Antonio,

1) Yes, you need to restart your apache-tomcat after changing localization and internationalization files (it's default setting of application context).

2) If some messages are not translated, you need to check if internationalization file (italian in your case) contains translated string. It may appear that i18n file is in place, but not all strings are translated.

Anton.

Link to comment
Share on other sites

Hi Anton, I'm again asking your help. maybe there's something wrong or that I miss.

1) I changed the internationalized setting on the Log-in page and now everything appears translated (labels, button ecc.).

2) I edited the jasperserver_config.properies and I've modified calendar.date.format and all the other lines, belows are the new lines

date.format=dd-MM-yyyy
datetime.format=dd-MM-yyyy HH:mm
calendar.date.format=dd-mm-yy
calendar.datetime.format=dd-mm-yy hh:mm
calendar.time.format=hh:mm

I do not if when changing the language from the main Log-in page, Jasper uses jasperserver_config.properies or jasperserver_config_it.properies, so I've edited and modified also jasperserver_config_it.properies file like the other.

But I have this problem: when I open the report  labels are translated in italian, calendar is italian but after clicking on close buttom of the popup calendar, date is copied in the field in the wrong way, ex. 2012-10-18 and not in dd-mm-yyyy format

If I'm trying to start the report I have a this message "Specify a valid value for type Date." as the format is not correct. Obviously i can edit and manually change in 18-10-2012 but it's not want I want ... I'd like that the calendar close button would work properly .... is there something that I miss?

I stop and restart tomcat but with no positive result. I saw that there is also a file named calendar_it.properties ... must I change some values in it? For Exemples the last lines # date formats
CAL_def_date_format=%Y-%m-%d
CAL_tt_date_format=%a, %b %e

CAL_week=wk
CAL_time=Time:

CAL_hour=Hour
CAL_min=Minute
CAL_now=Now

Link to comment
Share on other sites

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