We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Text Alignment issues when saving xls as html

Hi,

We noticed a few issues with center and right horizontal alignments when converting an xls file to html. We noticed two main issues here:

  1. The center alignment in the second row doesn’t reflect what’s displayed in the actual worksheet. It actually looks like it’s still left aligned.
  2. The right alignment in cell C3 is missing the overflow:hidden attribute, which causes it to overflow into all the data to it’s left.

TextAlignReproducer.zip (6.5 KB)

var workbookStream = new FileStream(“TextAlignReproducer.xls”, FileMode.Open);
var workbook = new Workbook(workbookStream);
var saveOptions = new HtmlSaveOptions { ExportImagesAsBase64 = true };
workbook.Save(@"…\textAlignReproducer.html", saveOptions);

@dfactset,

Thanks for providing us template file and details.

I have evaluated your scenario/case by both Aspose.Cells APIs and MS Excel (manually) and found the issues in both cases. I simply opened the XLS file into MS Excel and saved it as “Web page”. Now I open the output file into IE browser and found the output is even worst than the resultant file by Aspose.Cells. Aspose.Cells follows MS Excel standards and specifications when rendering Excel to HTML/PDF file format. If something cannot be achieved in MS Excel, then Aspose.Cells also might not accomplish the task. So, your mentioned alignment issue(s) might not be fixed.

Thank you.

Would it be possible to look into the right alignment issue and get a ticket opened? It seems like aspose already does some extra work to set the overflow:hidden attribute on the td elements to create a better looking html report. In this case, it seems more like an edge case that has been missed because you want text in the last column’s td to overflow in the left and center case, but not in the right text alignment case.

I understand that the center alignment issue may not be fixed, but it would still be nice to have a ticket opened for that as well to keep track of.

@dfactset,

Thanks for sharing further details.

Alright, we will evaluate your issue on our end. I have logged a ticket with an id “CELLSNET-45473” for product team’s considerations. Our concerned developer from product team will look into it and investigate if we could support your needs.

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

Thank you.

@dfactset,

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

Thank you.

@dfactset,

Pleaser try our latest version/fix: Aspose.Cells for .NET v17.7.3:


Your issue should be fixed in it.

Let us know your feedback.

Thank you.

Thanks, it’s looking really good. It seems like both the right and center alignment match the actual excel workbook.

@dfactset,

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

Thank you.

The issues you have found earlier (filed as CELLSNET-45473) have been fixed in latest version of Aspose.Cells for .NET (Download | NuGet).

The issues you have found earlier (filed as CELLSNET-45473) have been fixed in latest version of Aspose.Cells for .NET (Download | NuGet).