Free Support Forum - aspose.com

Icon Sets Become Misaligned on Conversion to HTML


#1

Hello,

The attached workbook IconSets.xlsx, contains a simple table with conditional formats that use Icon Sets.

Under the latest version of Aspose Cells for Java version 18.10 - when the workbook is saved as HTML, the resulting HTML shows the icons at an unexpected locations.

This can be reproduced with the following code:

  final String xlFile = [PATH] + "IconSets.xlsx";
  final String sheetName = "Sheet1";
  
  Workbook wb = new Workbook(xlFile);
  Worksheet sheet = wb.getWorksheets().get(sheetName);
  wb.getWorksheets().setActiveSheetIndex(sheet.getIndex());

  String htmlFile = xlFile.replace(".xlsx", "-" + sheetName + ".html");
  wb.save(htmlFile);
  System.out.println("Successfully created HTML file:\n  " + htmlFile);

When you view the produced HTML file in any browser, you should see the misaligned icons (as compared to the worksheet as rendered in Excel).

Thanks


#2

@oraspose,

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-42744 - Icon Sets become misaligned when XLSX is converted to HTML

#3

Thank you Ahsan!

Upon further examination, it seems that not only Icon Sets become misaligned - this issue also affects conditional formatting with Data Bars.

Attached please find MisalignedConditionalFormats.xlsx (8.0 KB) which contains several Conditional Formats. Each of the ranges where conditional formats are applied have conversion issues - which you can see by comparing the resulting HTML versus the way the sheet is rendered in Excel.

The commonality between the conditional formats (in the attachment) is that the underlying cell values are hidden and the cells (with the conditional formats) have different alignments. This seems to affect the alignment of the images that are used in the generated HTML.

Thanks again.


#4

@oraspose,

Thank you for providing more information. We have recorded this information with the logged ticket for our reference. We will consider it while working on this issue.


#5

@oraspose,

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


#6

@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)


#7

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: https://docs.aspose.com/display/cellsjava/Installation

This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi


#8

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.


#9

@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

#10

@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.


#11

@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)


#12

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


#13

@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.


#14

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