Hello,
Cells with a combination of the Accounting Format along with a small font (6 points or less) can cause the numeric values to become distorted when exported to HTML. This is regressive to Aspose Cells version 20.8 - which shows the values correctly when the workbook is exported to HTML.
This behavior can be seen in the latest Aspose Cells for Java version 21.3, the attached Arial_6pt_Font.xlsx file and the following Java code:
final String xlFile = [PATH] + "Arial_6pt_Font.xlsx";
Workbook wb = new Workbook(xlFile);
String html = xlFile.replace(".xlsx", "-v" + CellsHelper.getVersion() + ".html");
Files.deleteIfExists(Paths.get(html ));
wb.save(html );
System.out.println("Successfully created HTML file: " + html);
Key Observations:
- Under Cells 20.3, the numeric values become distorted because of the 6 pt font size. Changing the font size to 7 pt or higher produces the expected results in HTML.
- Running the above code under Cells 21.3, should produce a file similar to the attached
Arial_6pt_Font-v21.3.0.htmlfile. - Rendering the HTML output file in a Browser, shows the data values from “Table1” and “Table2” as distorted and different from how they appear in Excel.
- The 4 tables have the same data and all numeric values in the worksheet have the Accounting Number Format (as shown in the attached
AccountingFormat.pngscreenshot). The only differences between the tables are:
– Table1 has an Arial 6 pt Font, Word-wrap enabled.
– Table2 has an Arial 6 pt Font and Word-wrap disabled.
– Table3 has an Arial 7 pt Font and Word-wrap enabled (which displays correctly).
– Table4 has an Arial 7 pt Font and Word-wrap disabled (which displays correctly). - Running the same code under Aspose Cells for Java version 20.8, should produce a file similar to the attached
Arial_6pt_Font-v20.8.0.htmlfile. - Rendering the HTML output file from Cells 20.8 in a Browser, displays all 4 tables correctly.
Environment Details:
- Aspose Cells for Java 21.3 (for first run)
- Aspose Cells for Java 20.8 (for second run)
- Java version 1.8.0_211
- Windows 10 OS (but also reproducible under Linux).
File description in the Arial_6pt_Font.zip (20.6 KB) attachment contains:
- Arial_6pt_Font.xlsx: Excel workbook to be used by the code above.
- AccountingFormat.png: Screen shot of the Accounting Number Format applied to the numeric values in the worksheet.
- Arial_6pt_Font-v21.3.0.html: HTML output file produced from the code above under Aspose Cells 21.3.
- Arial_6pt_Font-v20.8.0.html: HTML output file produced from the code above under Aspose Cells 20.8.
Thank you!