Landray RDM EKP-1819 Convert Effect

cells source code:
src.zip (1.6 KB)

origin cells:
2023年9月小车油耗奖罚(已完成)+(1).xlsx.zip (53.4 KB)

before converted:
image.jpg (200.4 KB)

after converted:
image.png (274.9 KB)

Please have a check.

@hucq_landray_com_cn
Through further research and testing using sample files, we can reproduce the issue. It was found that the LOOKUP function obtained an incorrect value after calculation in a Chinese environment.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45672

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@hucq_landray_com_cn,

We evaluated your issue in details.

The issue was caused by the fact that we re-calculate the formulas before saving HTML but some Chinese characters cannot be sorted correctly by String.compareTo() method. To resolve this issue:

  1. Firstly, we will add one property HtmlSaveOptions.CalculateFormula so, you can disable the automatic calculation for formulas. For this case, the template file contains the correct results for formulas and does not need to be re-calculated.

  2. Secondly, we will enhance our calculation engine to support sorting Chinese characters (with the help of icu4j library). If you need to calculate formulas like those in this case, you may use below code example:

        Workbook wb = new Workbook(path);
        final com.ibm.icu.text.Collator collator = com.ibm.icu.text.Collator.getInstance(Locale.CHINA);
        collator.setStrength(com.ibm.icu.text.Collator.PRIMARY);
        wb.getSettings().setGlobalizationSettings(new GlobalizationSettings()
        {
            @Override
            public Comparable getCollationKey(String s, boolean ignoreCase)
            {
                return collator.getCollationKey(s);
            }
            @Override
            public int compare(String x, String y, boolean ignoreCase)
            {
                return collator.compare(x, y);
            }
        });
        wb.calculateFormula(false);

@hucq_landray_com_cn,

This is to inform you that your issue ("logged earlier as “CELLSNET-54162”) has been resolved. The fix will be included in our upcoming release (Aspose.Cells v23.11), which we plan to release in this week. You will be notified when new versions are released.

The issues you have found earlier (filed as CELLSJAVA-45672) have been fixed in Aspose.Cells for Java 23.11.