Free Support Forum - aspose.com

Open HTML and retain formatting?

Hi,

I am evaluating Aspose Cells and wondering if it’s possible to open an HTML file and retain the formatting.

Here is my situation: I have an existing reporting application that generates a large number of reports in HTML format. Most reports are simple tables, however there is a fair amount of formatting with regards to column widths, coloring, formatting of headers, etc. In the past, we have faked an “export to Excel” by simply appending an .xls extension onto our generated HTML files and letting Excel open them. This would retain the formatting and allow our users to manipulate their report data and save as a proper Excel-formatted file. This approach, however, is no longer viable because modern Excel versions regard HTML files as a potential security risk.

I’d like to user Aspose Cells to “convert” HTML reports into proper Excel files without losing the aesthetic formatting of the data. So far, it appears to have no problem open these HTML files and saving them as .xlsx files, however all formatting is lost and I’m left with a generically formatted sheet of data.

Thanks!

@mikebruner

Thanks for considering Aspose APIs.

Aspose.Cells supports loading HTML file and converting them to Excel file. Most of the conversions are good. However, not all conversions are good.

Aspose.Cells supports Microsoft Excel Oriented HTML. Suppose, you have some complex Excel file. You open it in Microsoft Excel and save it as in HTML format. Then the generated HTML is called Excel Oriented HTML. If you will load this Excel generated HTML with Aspose.Cells, then Aspose.Cells will successfully convert it back to Excel file.

Free form HTML, which is broken or which is copied from internet web pages, such HTML is not successfully converted to Excel file.