apache poi upgrade from 2.5 to 3.8 gives Excel error

这一生的挚爱 提交于 2019-12-10 23:12:07

问题


We need to provide support for Excel 2010 so have upgraded to Apache poi 3.8. But while downloading the excel it takes so much time for opening and also provides error message as "EXCEL found unreadable content. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click yes"

And after clicking "yes", it gives me one more pop up which says,

Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded. Removed Records: Merge cells from /xl/worksheets/sheet1.xml part

Kindly help me resolving this issue.

Thank-you


回答1:


I had a similar problem using POI 3.9

It was the following

  1. I created the XLSX spreadsheet in LibreOffice 4.0.2.2
  2. I could open this LibreOffice generated XLSX in Office 2010 with no problems
  3. With POI I opened this workbook and wrote to it. Very simple stuff, Strings only
  4. Office 2010 then reports that my XLSX is corrupt and 'fixes' it

I created a new XLSX in Word 2010 and modified it with POI 3.9 and the problem went away




回答2:


I had a exact problem using POI 4.0.0

The issue is with POI version. I downgrade the version from 4.0.0 to 3.17 and the problem resolved.



来源:https://stackoverflow.com/questions/16292939/apache-poi-upgrade-from-2-5-to-3-8-gives-excel-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!