#1 2017-11-15 17:34:31

phenaut
Member
From: FRANCE
Registered: 2017-10-30

fr localization for numbers ?

Dear all,
I'm tring to set-up the french localization for numbers coming from Jasper Report (In Jasper Studio, that's work fine) , they are currently with en-US Localization.
I uploaded this localization.cf without success :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <localization>
      <default>fr</default>
      <format>
         <shortDatePattern></shortDatePattern>
         <longDatePattern></longDatePattern>
         <shortTimePattern></shortTimePattern>
         <longTimePattern></longTimePattern>
         <shortDateTimePattern></shortDateTimePattern>
         <longDateTimePattern></longDateTimePattern>
         <numberPattern># ##0,00</numberPattern>
         <currencyPattern># ##0,00€</currencyPattern>
         <integerPattern># ##0</integerPattern>
         <percentPattern></percentPattern>
      </format>
   </localization>
</configuration>

Any idea ?

Last edited by phenaut (2017-11-15 17:36:12)

Offline

#2 2017-11-16 11:08:07

eduardo
Administrator
Registered: 2016-11-01
Website

Re: fr localization for numbers ?

Hi phenaut,

did you restart your reportserver or reloaded the configuration opening the terminal and writing "config reload"?
Where did you "upload" the file localization.cf ?

Regards,
Eduardo

Offline

#3 2017-11-29 08:47:38

phenaut
Member
From: FRANCE
Registered: 2017-10-30

Re: fr localization for numbers ?

Hello Eduardo,
I restarted the server with config reload ans I uploaded the file directly from the back office over /etc/main/
With the first files (first post), I lost the date format and was unable to select date in drop down list box, so the localization.cf is used.
I made a new test with this one :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <localization>
      <default>fr</default>
      <format>
      <!--
         <shortDatePattern></shortDatePattern>
         <longDatePattern></longDatePattern>
         <shortTimePattern></shortTimePattern>
         <longTimePattern></longTimePattern>
         <shortDateTimePattern></shortDateTimePattern>
         <longDateTimePattern></longDateTimePattern>
      -->
         <numberPattern># ##0,00</numberPattern>
         <currencyPattern># ##0,00</currencyPattern>
         <integerPattern># ##0</integerPattern>
      <!--
         <percentPattern></percentPattern>
      -->
      </format>
   </localization>
</configuration>

Only number are modified and this has no effect, the decimal separator stays '.' and the thousand ','
Any suggestion ?

Offline

#4 2018-02-16 11:55:44

phenaut
Member
From: FRANCE
Registered: 2017-10-30

Re: fr localization for numbers ?

Hello Eduardo,

this issue is still pending... I see the dynamic lists are correct but not the jasper reports. I think it's not a problem of localization.cf but a problem with the value REPORT_LOCALE wich is still in 'US'. how to force the parameter REPORT_VALUE to 'fr' in reports, for your help :
https://community.jaspersoft.com/docume … rt-locales

Thanks a lot for your feed back.
Best Regards.

Offline

#5 2018-02-19 11:07:56

eduardo
Administrator
Registered: 2016-11-01
Website

Re: fr localization for numbers ?

Hi phenaut,

it seems jasper locale is not correctly set, as you point out. Where exactly did you see that "REPORT_LOCALE" is still "US"?
You should also have the reportserver parameter "_RS_LOCALE", which should be "fr" if you select french. This is an implicit parameter available in all reports.

Could you also check with BIRT? In BIRT it should work, since the locale is being explicitly set. In BIRT, the locale is set to the "_RS_LOCALE" value.

For your information: we are investigating this issue in the ticket RS-2878.

Regards,
Eduardo

Offline

#6 2018-02-19 14:56:48

phenaut
Member
From: FRANCE
Registered: 2017-10-30

Re: fr localization for numbers ?

Hello Eduardo,

I'm not able to see in ReportServer the value of "REPORT_LOCALE", I said it's still 'US' because from JasperSoft Studio, i can switch the REPORT_LOCALE value between 'US' and 'FR' ans I saw the same behaviour.
Regarding BIRT, every thing is correct from this side the format 'FR' is well understood by Reportserver.

Is there a workaround to set the value of "_RS_LOCALE" directly via the admin ?

Thanks a lot for your support.

Offline

#7 2018-02-19 15:23:50

eduardo
Administrator
Registered: 2016-11-01
Website

Re: fr localization for numbers ?

Hi phenaut,

I have been testing, and I see in jasper the correct locale when I print a dynamic string with the following:
"Locale: " + $P{REPORT_LOCALE}

The REPORT_LOCALE parameter is an implicit jasper parameter. In my case I am seeing the correct locale I chose: "Locale: de_DE".
I am choosing german when I log in into reportserver.

Can you please check this?
1. Log in to reportserver selecting french as a language
2. execute a jasper report that prints its locale using: "Locale: " + $P{REPORT_LOCALE}

Regards,
Eduardo

Offline

#8 2018-02-19 15:46:43

eduardo
Administrator
Registered: 2016-11-01
Website

Re: fr localization for numbers ?

Hi phenaut,

ok, when I select another language I still see "de_DE" in jasper. It seems it gets the default locale in the system, not the selected one.
BIRT behaves differently: if I print the locale using
"Locale: " + reportContext.getLocale().toString()
I see the selected locale.

This seems to be a bug. I will update here when I have more information.
In the meanwhile, check this: https://forum.reportserver.net/viewtopic.php?id=222 , #4 in order to set the jasper "REPORT_LOCALE" parameter by-hand. As this should happen by default (without the script), I think this is a bug. Keep tuned, I will update this thread.

Regards,
Eduardo

Offline

#9 2019-02-04 17:13:08

phenaut
Member
From: FRANCE
Registered: 2017-10-30

Re: fr localization for numbers ?

Hello Eduardo,
I found a workaround that works for single report not for books.
I added manually on the top of report source :

<property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>

This line is not allowed in book,
any idea ?

Last edited by phenaut (2019-02-04 17:15:14)

Offline

#10 2022-10-21 13:02:17

eduardo
Administrator
Registered: 2016-11-01
Website

Re: fr localization for numbers ?

Hi phenaut,

pls note that as of ReportServer 4.4.0, the REPORT_LOCALE parameter will be sent automatically to the Jasper engine.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB