Excel found unreadable content in XLSX file (Aspose Cells Java)



hi

we are trying to generate xlsx file using LightCelldataprovider.

we are getting some error messages.

Excel found unreadable content in ‘xxx.xlsx’. Do you
want to recover the contents of this workbook? If you trust the source
of this workbook, click Yes.

please find the attached files.

Thanks & Regards
Ranjith.



Hi Ranjith,


Thanks for your output file. I can see there is some problem with it. But we can not figure it out without your source code.
Attached to my reply is the latest fix release of Aspose.Cells JAVA v2.5.3.8. Kindly test this scenario with attached JAR. Also test the AutoFit column issue that you mentioned in your other post and let us know of your feedback on both. If your issues are not solved then please share your complete source code and any template file you are using. We will look into it soon.

Thank you

hi

we are still facing the issue

Thanks & Regards

Ranjith.

Hi Ranjith,


Please share your complete source code (if possible share the project). We will look into this matter very soon. Thank you

hi

please find source code and input files.

and we getting this error in case xlsx file opening.

"com.evermind.server.http.HttpIOException: Connection reset by peer: socket write error"
in interntet explorer only.


stack:

com.evermind.server.http.HttpIOException: Connection reset by peer: socket write error

at com.evermind.server.http.EvermindServletOutputStream.flush(EvermindServletOutputStream.java:286)

at java.io.FilterOutputStream.flush(FilterOutputStream.java:123)

at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:410)

at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)

at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)

at java.io.BufferedWriter.flush(BufferedWriter.java:230)

at org.dom4j.io.XMLWriter.flush(XMLWriter.java:272)

at com.aspose.cells.er.a(Unknown Source)

at com.aspose.cells.er.a(Unknown Source)

at com.aspose.cells.hu.s(Unknown Source)

at com.aspose.cells.hu.a(Unknown Source)

at com.aspose.cells.kH.a(Unknown Source)

at com.aspose.cells.iD.b(Unknown Source)

at com.aspose.cells.iD.a(Unknown Source)

at com.aspose.cells.Workbook.save(Unknown Source)

at _eisrs._jsp._reporting._EiSRSGenerateExcelJsp.CreateExcel(EiSRSGenerateExcelJsp.jsp:92)

at _eisrs._jsp._reporting._EiSRSGenerateExcelJsp._jspService(EiSRSGenerateExcelJsp.jsp:15)

at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139)

at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)

at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)

at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)

at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)

at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)

at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)

at java.lang.Thread.run(Thread.java:534)



Thanks & regards
Ranjith

Hi Ranjith,


Thank you for sharing the exception logs and your source code with us. But I don’t think this exception is related to Aspose.Cells API. Any how, I have attached this thread to a ticket that was created earlier for your post on the same issue [Excel found un-readable contents in your file]. Also, I have re-opened the ticket. Soon we will post you back.
Thank you.

hi

we found solution.

problem is with the stream.

stream will be closed abnormally.

so it gives unreadable content. to fix this we set the

“response.setHeader(“Content-Length”, “”+file.length());”

this one working fine in case of file downloading.

if the file is generated in heap at that time “stream will be closed abnormally”.

so we must set “content-length” before generating the file.

there is post in your forums.

in that you fixed the same issue. in that case file is saved to disk.

``

please update your webdemo examples.

Thanks & Regards

Ranjith.

Hi,


Good to know that you have solved one of your problems. I have attached your comments to the ticket associated with this thread.

Thank you.

Hi,

We did found similar error of the reset or closed output stream when saving workbook in jsp by testing your jsp file.

But we do not think this is the issue of our component because such kind of issue occurs for saving any data to the output stream of web response even without any reference to cells component. And the same logic will work fine when use servlet instead of jsp.

So we think it is the issue of processing response and sending data to output stream in jsp. As you have found and tested, set proper “Content-Length” property to the response may be a solution for such kind of issue.