Excel not generating from HTML file

Hi,


I am using aspose-cells-16.12.0.jar with JDK 1.7. I want to generate the excel from HTML file. I am able to generate the excel file but generated file has uncomplete content.

Content in HTML file :


<span style=“font-family: “times new roman”;”>Hi Fanny,<br style=“font-family: “times new roman”;”><br style=“font-family: “times new roman”;”><span style=“font-family: “times new roman”;”>Urgent !! <br style=“font-family: “times new roman”;”><br style=“font-family: “times new roman”;”><br style=“font-family: “times new roman”;”><span style=“font-family: “times new roman”;”>SPR’17 - S/545175 – ADSO# 16843754;<div style=“font-family: “times new roman”;”>SPR’17 - S/545175 – ADSO# 16843754;
HOL’16 - S/325805 – ADSO# 16702460;
SPR’17 - S/325805 – ADSO# 16843753;
SPR’17 - S/325808 – ADSO# 16843752;
fdzjchxk;shdgasz;ASDO;fhsjdzx

dyzhbsxz;sdhbdugvfd;36457q;sfdnzcx;



Best regards
Aileen Wang
Tel: 0111-2234 2765
<div style=“font-family: “times new roman”;”>
<div style=“font-family: “times new roman”;”>Content in generated excel file : <div style=“font-family: “times new roman”;”>
SPR’17 - S/545175 – ADSO# 16843754;
<div style=“font-family: “times new roman”;”>
<div style=“font-family: “times new roman”;”>

Hi,

Thanks for providing us details.

Please try our latest version/fix: Aspose.Cells for Java (Latest Version)

If you still find the issue with v17.3.7, kindly do provide us template HTML file (you may zip the html archive and attach it here), we will check your issue soon.

Thank you.

Hi,


Thanks for providing the updated jar file.
I tried to generate the excel file from HTML using aspose-cells-17.3.7.jar with JDK 1.7. But, i am getting the same output.
I am attaching the input and output file. Please look into this and suggest.

Thanks,
Pankaj Jain

Hi,


Thanks for your posting and using Aspose.Cells.

Your html does not open in Excel but in corrupted way. Please see this screenshot that shows how your html looks when we view it in MS-Excel 2016.

Please note, if MS-Excel 2016 cannot render your html, then Aspose.Cells will automatically be considered unable to render it and convert it to xls or xlsx format.

Hi,

Thanks for considering Aspose.Cells.

I have attached the excel oriented html https://forum.aspose.com/t/18163 which opens fine in MS-Excel and Aspose.Cells converts it to xls format fine.

I have converted this excel oriented html to xls format using Aspose.Cells with the following code. Please see the screenshot the https://forum.aspose.com/t/18163 that shows the output excel file https://forum.aspose.com/t/18163 generated by Aspose.Cells.

Java

Workbook wb = new Workbook(dirPath + “excel-oriented.htm”);

wb.save(dirPath + “out.xls”);

Hi,


Thanks for your quick reply.
Is there any way so that i can convert my corrupt/ non excel oriented HTML file (without changing the structure of present html file) into excel using aspose jar.


Thanks,
Pankaj Jain

Hi,


Thanks for your posting and using Aspose.Cells.

When we say excel-oriented html, it means, use only those html tags which MS-Excel uses. The good way is that you save your excel file to html manually and check what html tags it use, then try to use those tags alone. Also, whenever you have any html, please try to open it in MS-Excel first, if it opens fine, then Aspose.Cells should be able to understand it.

There is no programmatical way of making your html, excel-oriented. There is only a manual way. I first opened your html in Chrome, then I copied its contents to MS-Word and saved it as html and then I opened it in MS-Excel and again saved it as html and finally I use Aspose.Cells to convert that html to excel file.

Hi,

I am generating the HTML to Excel file using aspose-cells-17.1.7.jar.
But at run time an error is occurring and blank excel file is generating.
Please provide a solution so that i can generate the excel file with full data without upgrade the aspose-cells-17.1.7.jar

Thanks,
Pankaj Jain

@pankajadeptia

Thanks for using Aspose APIs.

We were able to observe this issue and logged it in our database for an investigation and for a fix.

This issue has been logged as

  • CELLSJAVA-42332 - Aspose.Cells is not able to convert the HTML file correctly while MS-Excel is able to convert it properly

Java

Workbook wb = new Workbook(dirPath + “CompleteEmail.html”);
wb.save(dirPath + CellsHelper.getVersion() + “-ByCells.xlsx”);

All-Files.zip (38.9 KB)

@pankajadeptia,

Please try the latest version/fix: Aspose.Cells for Java (Latest Version)

Your issue should be fixed in it.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-42332) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.