Fullstop is replaced by comma in excel to pdf rendition(ECDCTS-9137)

Hi Team,

We tried to transform the *.xls to pdf using below code. In Output file fullstop(.) is replace with comma(,).

        Workbook doc = new Workbook("C:\\Docs\\9137\\Excel.xls");
        doc.save("C:\\Docs\\9137\\output.pdf");

9137.zip (134.0 KB)

Thanks,
Arvind

@rnara,

It might be due to you locale/regional settings. What is your regional or locale settings of your environment/system? Could you please try the following sample code and let us know your results.
e.g.
Sample code:

Workbook doc = new Workbook(stringFileName) ;
doc.getSettings().setRegion(CountryCode.USA);
doc.save("out1.pdf"); 

Hi Team,

As now of we are not setting regional. Can you lets know if we don’t use this doc.getSettings().setRegion(CountryCode.USA) what default value it picks?

Also if we use this setting will it impact any changes to existing rendition request?

Thanks,
Arvind

@rnara,

If you do not specify the regional/locale settings, your environment/OS locale settings (where you process the code) would be picked.

There should be no significant issues/changes when using the USA locale settings.

Hi ,

If we use following code what will be the region ?doc.getSettings().setRegion(CountryCode.DEFAULT);

Thanks,
Arvind

@rnara,

It will refer to the regional/locale settings of your environment/OS (where you process the code) or denotes to locale settings set in your code.

Hi,

The following code is returning ‘0’ (Zero). How can we test whether it’s referring to regional/local settings of our environment/OS or not?

doc.getSettings().setRegion(CountryCode.DEFAULT)

Regards,
Pavan

@rnara,

Returning zero (‘0’) for the method means success or successful termination. Any non zero value means failure. If you want to use regional/locale settings of the OS, you may even remove or skip your line of code.

Hi Team,

We tested the following code for FRANCE and NORWAY region it not working as expected. Fullstop is replaced with comma(,).

doc.getSettings().setRegion(CountryCode.FRANCE);
doc.getSettings().setRegion(CountryCode.NORWAY);

Excel_FRANCE.pdf (47.3 KB)
Excel_NORWAY.pdf (47.3 KB)

For USA it works as expected
doc.getSettings().setRegion(CountryCode.USA);

Excel_USA.pdf (47.3 KB)

Can you please look into this issue.

Thanks,
Arvind

@rnara
In FRANCE and NORWAY, Fullstop should be replaced with comma(,), so all of your attached PDFs are ok.
Could you explain more about your need?

Hi Team,

Is there any other region also where Fullstop should be replaced with comma(,) ?

I tried for SWEDEN also, Fullstop are replaced with comma(,) in output PDF

Thanks,
Arvind

@rnara,

Whether the ‘.’ should be replaced with ‘,’ depends on not our component, but the regional settings of specific locale. We think you may iterate all possible locales to list the separators. Code example:

System.out.println(new DecimalFormatSymbols(Locale.GERMAN).getDecimalSeparator());

Hi Team,

How we can check whether it is referring to region/local settings of our environment/OS ?

Do you have any code snippet ? Thanks.

@rnara,

You may try the line of code to get regional/locale settings of your OS/environment.
e.g.,
System.out.println(Locale.getDefault());

Moreover, using Aspose.Cells API, you may try the lines like following:

//Instantiating a Workbook object
Workbook workbook = new Workbook();
System.out.println(workbook.getSettings().getLocale());