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

Free Support Forum - aspose.com

Convert from HTML to XLS

Hi team,

We currently use Aspose to convert our HTML output into a Microsoft Excel document.

The html:
col1 col2 col3
col1 col2 col3
col1 col2 col3
before<>after col2 col3

Output:
The first 3 rows are fine and displays:
col1,col2,col3
The row which represents the fourth row is incorrect. The first cell in the row is blank and the second cell only contains the word before.
BLANK,beforecol2,col3




Hi,


After an initial test, I observed the issue as you mentioned by using the following sample code. I found an issue with HTML to Excel renderings, on the forth row, Aspose.Cells renders it as:
beforecol2 col3
instead of:
before<>after col2 col3
in the output Excel file.
e.g
Sample code:

string html = @"








col1 col2 col3
col1 col2 col3
col1 col2 col3
before<>after col2 col3


";

// Aspose XLSX prep
byte[] byteArray = Encoding.ASCII.GetBytes(html);
MemoryStream stream = new MemoryStream(byteArray);
Workbook workbook = new Workbook(stream);
Worksheet sheet = workbook.Worksheets[0];
// sheet.AutoFitColumns();

workbook.Save(“e:\test2\out1.xlsx”);

I have logged a ticket with an id “CELLSNET-44072” for your issue. We will look into it to figure it out soon.

Thank you.