-1

I want to convert the HTML to Excel using aspose cell in Java, but the generated Excel skipping the content.

HTML content :

Hi Fanny,    
Urgent !!     
SPR'17 - S/545175 -- ADSO# 16843754;
SPR'17 - S/545175 -- ADSO# 16843754;    
fdzjchxk;shdgasz;ASDO;fhsjdzx    
dyzhbsxz;sdhbdugvfd;36457q;sfdnzcx;    
Best regards    
Tel: 0123-1234 8765

Generated Excel file content :

SPR'17 - S/545175 -- ADSO# 16843754;

I am using aspose cells-16.12.0.jar and there is not any error occurring. The Content doesn't has any image or table etc but have special symbol. The code is executing fine without any error. I feel special symbol is creating the problem.

halfer
  • 19,824
  • 17
  • 99
  • 186
pankaj
  • 11
  • 6
  • 2
    *The code is executing fine without any error* Which code? – Jens Apr 07 '17 at 07:14
  • yes without any error – pankaj Apr 07 '17 at 07:27
  • 1
    May we see the code you've written? Readers probably cannot help without seeing that. – halfer Apr 07 '17 at 07:54
  • Please find the code : – pankaj Apr 07 '17 at 10:23
  • Please find the code : public void writeExcelFile(String htmlFileLocation,String htmlFileName,String excelFileLocation,String asposecellsLicenceLocation,String fileExtensionName) throws Exception { try { HTMLLoadOptions options = new HTMLLoadOptions(LoadFormat.HTML); Workbook book = new Workbook(htmlFileLocation + "\\" + htmlFileName, options); book.save(excelFileLocation + "." + fileExtensionName.trim(),5); }catch (Exception ex) { ex.printStackTrace(); } } Sorry code is not appearing readeable – pankaj Apr 07 '17 at 10:33
  • actually my HTML file don't have proper structure mean don't have HTML, body etc tag. it has div tags etc. – pankaj Apr 07 '17 at 10:45
  • You may also like to see this thread ---https://www.aspose.com/community/forums/thread/834981/excel-not-generating-from-html-file.aspx --- by Shakeel working as Developer Evangelist at Aspose. – shakeel Apr 10 '17 at 15:05
  • Post your code in the question. Comments are not for relevant information like that. If you are thinking that we will take the time to read through that comment without formatting, you are severely mistaken. – Mad Physicist Apr 10 '17 at 17:06

1 Answers1

0

Aspose.Cells supports to read/write MS Excel-oriented HTML file, it means, you got to use only those HTML tags which MS-Excel uses in the formation of the file. I guess your template HTML is not good. I think you may try to open the HTML file into MS-Excel first to check if it is opened fine or not. If MS Excel opens the file fine then Aspose.Cells APIs should be able to read it fine.

Amjad Sahi
  • 1,813
  • 1
  • 10
  • 15