Wrong Culture Custom Format gets returned (Germany, Spain, French, and Italy)


#1

Hello.

​We are running into an issue where Aspose.cells for Java is returning the wrong Culture Custom format to us. Please use the attached NumberFormat_IT.xlsx workbook and the following code to print out the culture customs.

You will see that the formats get returned is #.##0 _¤;[Red]-#.##0 ¤ while the expected format is #,##0);Red.

​This issue is found in the version of 18.7 of Aspose.Cells for Java we are currently using as well as in the latest version of 18.11.

The same test case works fine in version of 17.6.3, where the culture custom format #,##0_);Red is returned as expected.

We need this fixed in the Java version asap.

Thank you for your assistance.

public static void printCultureCustomFormats() throws Exception{
    String dir = "C:/asposetest";
    Locale locale = new Locale("it");
    Workbook workBook = new Workbook(dir + "/NumberFormat_IT.xlsx");
    workBook.getSettings().setLocale(locale);
    Worksheet sheet = workBook.getWorksheets().get(0);
    Cells cells = sheet.getCells();
    
    for(int i = 0; i < cells.getMaxDataRow()+1; i++){

        for(int j = 0; j < cells.getMaxDataColumn()+1; j++){
            Cell cell = cells.get(i, j);
            if(cell.getValue() != null) {
                System.out.println("Cell value: "+cell.getValue()+" Culture Custom: "+cell.getStyle().getCultureCustom());
            }
        }
    }
}

P.S. it doesn’t let me upload a file with an extension .xlsx. Is there an option to provide you a copy of the xlsx file that is used in the test code above?

NumberFormat_IT.zip (7.2 KB)


#2

@ibmlittleton,

Thanks for the sample code and details.

We need your template file to evaluate your issue. Please zip your template file and attach it here, we will check it soon.


#3

Hi Amjad,

Thanks for your prompt reply. I’ve uploaded the template file and attached in the post.

Please also note that the same issue is found with Italy as well as Germany, Spain, and French. There isn’t an issue back in the version 17.6.3.

Any additional information you need that i can provide, please just let me know.

Thanks

Anything else


#4

@ibmlittleton,

Thanks for the template file and further details.

After an initial test, I am able to observe the issue as you mentioned by using your template file and sample code. I found that wrong culture custom format is returned for different locales (Germany, French, Italy and Spain). I have logged a ticket with an id “CELLSJAVA-42768” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.


#5

Hi Amjad,

Do you have any update on this issue?

Can you please upgrade this issue to move it to the Enterprise Support forum?

It is a regression in the version of 18.7 Aspose.Cells for Java and onwards. This impacts a number of our customers. Can you please help escalate this issue to enterprise and get us a fix as soon as possible.

Thanks for your support!


#6

@ibmlittleton,
We are discussing this requirement and will update you soon.


#7

@ibmlittleton,

For CultureCustom, culture means it represents the culture depended custom pattern for formattings. However, it is hard for us to support all regions at a time. And the culture date patterns for some locales such as Italy were not supported in older versions. In recent versions we have supported some other locales for CultureCustom according to some other users’ scenario and requirement. To get the standard formatting pattern, please use Style.Custom instead of CultureCustom.

Also, we have tested the display formatting in MS Excel manually for different locales. Please see the attached screenshots. Custom_IT.png is what is shown by MS Excel with the set region of Italy for one of our machine. And Custom_US.png is the result when change machine’s region to en-US. We think our component gives the correct results.
Custom_IT.png (10.2 KB)
Custom_US.png (12.2 KB)


#8

Thanks for your response.

In this case, Style.Custom doesn’t return anything. We are blocked here.

Can you please advise?

Thanks for your support!


#9

@ibmlittleton,

You are right, I can see Style.Custom attribute gives blank value in your case. We need to evaluate your issue thoroughly and quickly as you have now availed Enterprise support service for this issue. Hopefully we will figure your issue out soon.


#10

@ibmlittleton,

The formatting of those cells was set as built-in and it is designed for Style.Custom that it will return empty for builtin number formats. For your requirement, we now plan to provide another property Style.InvariantCustom, which is corresponding to Style.CultureCustom but it will give the culture-independent custom pattern instead (including the pattern string for builtin number formats).

Hope, this will suit your needs.


#11

@Amjad_Sahi.

That sounds good. I am looking forward to giving it a shot when the new jar is avalilable.

Thanks for your support!


#12

@ibmlittleton,

Since you have availed Enterprise support service for this issue, so you should be getting the fix soon.