Icon Sets Become Misaligned on Conversion to HTML

@oraspose,

Please try our latest version/fix: Aspose.Cells for Java v18.11.1 (attached)

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells for Java_v18.11.1.zip (6.3 MB)

The issues you have found earlier (filed as CELLSJAVA-42744) have been fixed in Aspose.Cells for Java 18.12. You can also get the latest Aspose.Cells for Java version from Maven repos. with simple configurations. Please see the document for your reference: Installation|Documentation

This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi

Amjad,

Thank you for providing the fix to the secondary “misalignment issue” we raised above. We have tested the fix under the latest Cells version 19.1 and it looks good. However, this fix may have caused regression on other types of conditional formats that do not use icon sets.

Please try the code described at the top of this thread but using the attached MissingDataWithCondFmts.xlsx workbook. If you compare the HTML output to the XLSX file, you can see that the data in columns D and F - which have conditional formatting - is omitted when viewed in a browser.

Specifically, if you examine the generated HTML, you can see the following pattern:

<td height='19' class='x24' width='86' style='text-align:right;mso-ignore:style;font-size:11pt;color:#000000;
    font-weight:400;text-decoration:none;text-line-through:none;font-family:"Calibri";background:#FEEA83;
    mso-pattern:auto none;' align='left' valign='top'>
  <div  style='mso-ignore:vglayout2;margin-left:0px;'>
   <table cellpadding='0' cellspacing='0'>
    <tr>
      <td height='19' class='x24' width='86' align='right' x:num="1.415718438682356" x:fmla="=B3/C3"
          style='visibility:hidden'>142%</td>
    </tr>
   </table>
  </div>
</td>

Note that the 'visibility:hidden' style used in the <td> of the inner <table> node is causing the cell values to be hidden.

If there is a way to workaround this by specifying specific HtmlSaveOptions or something else please let us know. Otherwise, we may not be able to use Cells 19.1 because of the regression.

Thanks again.

@oraspose,

We are afraid to share that no workaround is available for this issue. We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-42826 - Data with conditional formatting ommitted while XLSX to HTML conversion

@oraspose,

This is to inform you that we have fixed your issue “CELLSJAVA-42826” now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@oraspose,

@softwarelicense_aixgroup_com,

Please try our latest version/fix: Aspose.Cells for Java v19.1.8 (attached):

Your issue “CELLSJAVA-42826” should be fixed in it.

Let us know your feedback.
Aspose.Cells for Java_v19.1.8.zip (6.4 MB)

Thank you Amjad! The patch works well. :smiley:

@oraspose,

Good to know that your issue is sorted out by the hotfix. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSJAVA-42826) have been fixed in Aspose.Cells for Java 19.2. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi

We are looking into upgrade of Aspose.Cells to version 23.11 and noticed possible regression in the way HTML is created for this use case.
The most significant difference is around changing all <div elements within table cells into <span , although it might not be the root cause of this issue.
Please take a look at the attached zip file , containing:

  • Small sample program illustrating the issue
  • ConditionalFormatsIcons.xlsx - input template (similar to the one reported in the original issue)
  • ConditionalFormatsIconsOutputCells_v21.3.0.docx
    and
  • ConditionalFormatsIconsOutputCells_v23.11.0.docx - output word documents after inserting the HTML generated from the excel template.
    Looks like icons that were previously center-aligned , now are pushed to the left. Same with the right-aligned icons.

Environment details:

OS Name: Microsoft Windows 11 Pro; also reproducible on Linux 7
MS Office: Version 2208 Build 16.0.15601.20698 32-bit

Please let us know if you need anything else.
Thank you.
ConditionalFormatsIconsMisalignedIssue.zip (46.6 KB)

@oraspose
Please check the generated html
23.11.zip (5.0 KB)

It can display fine in brower. So maybe we should check this issue with Aspose.Words.
If you think so too, I will move this issue to Words formun.
Sorry for inconvenience caused by our change.

We agree that a browser will render the HTML properly, but ultimately we are concerned about how it renders in Word. While we could ask the Aspose Word team to look into this issue - it’s quite possible that they will suggest that we ask the Cells team to fix the HTML. We’d like to avoid a catch-22 situation.
Because the output from Cells version 21.3 produces the appropriate output (in Word) - this issue may prevent us from upgrading to version 23.11. Is there any way we can revert to the same HTML output that we currently get under Cells verison 21.3?

@oraspose,

We apologize for the inconvenience. We will look into it and get back to you soon.

@oraspose,

Sorry for any inconvenience caused. In early versions, we adopted left alignment and then increased offset to adjust the position.
For example:

text-align:left, margin-left:30px

In the latest version, we have adopted alignment consistent with Excel, with a small amount of relative positional offset.
For example:

text-align:center, margin-left:-7.5px

In the browser, the display effect remains the same as before and can be perfectly presented. The deviation between the old and new versions after importing into Word is mainly due to Word’s inability to parse correctly. Therefore, to solve the issue of positional errors after importing into Word, you need to create relative issue on the Word forum.

Hello team.
We are starting to evaluate upgrade of Aspose.Cells (currently using version 24.10) and noticed regression in creating of HTML from Excel range with conditional formats . This same input produced proper HTML but with version 25.11 the icons are not aligned and there seems to be repetitions .
Attached archive contains the comparison between HTML produced by version 24.10 and 25.10 as well as input Excel sheet containing the ranges in question “IconSetLeftAlign” “IconSetRightAlign”, “IconSetCenterAlign”. The same sample code that was used previously can be used to produce attached HTML output.
Thank you.
ConditionalFormatsWithIcons.zip (37.6 KB)

@oraspose,

I used latest version/fix: Aspose.Cells for Java v25.11 with yoru template Excel file using the following sample code, it works OK.
e.g.,
Sample code:


        try (FileInputStream fstream = new FileInputStream("d:\\files\\ConditionalFormats.xlsx")) {
            // Instantiate a Workbook object that represents the existing Excel file
            Workbook workbook = new Workbook(fstream);

            // Get the named range
            Range range = workbook.getWorksheets().getRangeByName("IconSetLeftAlign");

            // Set the print area of the first worksheet to the address of the named range
            workbook.getWorksheets().get(0).getPageSetup().setPrintArea(range.getAddress());

            // Create HtmlSaveOptions and set desired properties
            HtmlSaveOptions saveOptions = new HtmlSaveOptions();
            saveOptions.setExportImagesAsBase64(true);
            saveOptions.setExportPrintAreaOnly(true);
            saveOptions.setExportHiddenWorksheet(false);
            saveOptions.setExportActiveWorksheetOnly(true);

            // Save the Excel file as HTML
            workbook.save("d:\\files\\out1.html", saveOptions);
        }

Please find attached the output HTML for your reference.
out1.zip (4.3 KB)

Could you please share your code snippet that you are using to produce error results (contents/shapes not aligned and repetition of objects). We will look into your issue soon.

Test code attached. It was used to check both HTML produced , as well as resulted word after inserting html into empty Word document.
Thank you.
JavaSample.zip (2.9 KB)

@oraspose,

Thanks for the sample code snippet.

I tested your scenario/case using your sample code snippet and template Excel file. I found Iconsets are misaligned and duplicated when ranges (from XLSX spreadsheet) are converted to HTML to DOCX. I spotted the issue especially with icons/shapes rendered with centered-aligned and right-aligned.

We require thorough evaluation of the issue. 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-46557

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.

Thanks for looking into it.
There seems to be similar / related issue with another multi-conditional icons set (named range “MultiCondIconSet”). It was previously noted on a separate thread : Icons get superimposed over numbers when Excel named range exported to HTML ).
Attached is comparison of HTML output with Excel input . Note that right-aligned icon are all disappearing, and center-aligned seemed to be cut off.
This can be reproduced with the same previously attached sample test.

Thank you.
MultiCondIconSet_issue.png (126.9 KB)

@oraspose,

Thank you for sharing the additional details and the screenshot.

I have already reviewed the issue you demonstrated and can confirm it. It appears that the HTMLs generated for right-aligned icons are completely disappearing, while those for center-aligned icons seem to be partially cut off. We have documented the details, along with the screenshots and observations, under the ticket “CELLSJAVA-46557” in our database. We will look into this matter at the earliest opportunity.