You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by roychav <ro...@gmail.com> on 2012/08/04 00:55:19 UTC

Re: Unreadable Content using XSSF POI 3.8, while writing to response.getOutputStream()

Hi Lokesh,

I have the same problem, could you show me, how your class was finally? I
dont have clearly how do you identify or detect the garbage binary
characters.

Could you help me?

Thanks in advance.



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Unreadable-Content-using-XSSF-POI-3-8-while-writing-to-response-getOutputStream-tp5710172p5710609.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: Unreadable Content using XSSF POI 3.8, while writing to response.getOutputStream()

Posted by Lokesh Puri <lp...@sapient.com>.
This error what I understood can be due to various reasons. Excel 2003 wasn't as restrictive as 2007 due to which we encounter such an issue. It is a generic error that Excel 2007 gives in case the data is not proper.

1st Encounter
In my case I was reading from a temp Excel file (created on server using poi 3.8 - which use to open properly) and writing to response.getOutputStream() and this file was giving me errors. I found that while copying (using streams) I was adding few bits which were garbage.

2nd Encounter
I am using Spring 3.0 MVC with annotations for my app,  I was having @ResponseBody as the return type for the above method in controller, wherein i use to return "successful" or "unsuccessful" just to indicate success or failure. I realised this was also causing issue, since this "successful" string use to get appended to response.getOutputStream().

3rd Encounter
Also check that the mime type is proper, excel 2007 has a different mime type than excel 2003. It gives the same issue if its wrong.

My two bits, Take code out of ur app, if its multi sheets, do 1 sheet at a time, try doing a poc separately and check each sheet, you will realise where the problem is or else try to reduce the no of records you are printing in the sheets.

P.s. try not to use Sxssf with templates (it still doesn't work as expected). I hope you are using Xssf only. With Sxssf you can only write stuff and is perf wise much better than Xssf but please don't use templates (another place where I encountered above problem).


________________________________
From: roychav [via Apache POI] [ml-node+s1045710n5710609h52@n5.nabble.com]
Sent: Saturday, August 04, 2012 4:25 AM
To: Lokesh Puri
Subject: Re: Unreadable Content using XSSF POI 3.8, while writing to response.getOutputStream()

Hi Lokesh,

I have the same problem, could you show me, how your class was finally? I dont have clearly how do you identify or detect the garbage binary characters.

Could you help me?

Thanks in advance.

________________________________
If you reply to this email, your message will be added to the discussion below:
http://apache-poi.1045710.n5.nabble.com/Unreadable-Content-using-XSSF-POI-3-8-while-writing-to-response-getOutputStream-tp5710172p5710609.html
To unsubscribe from Unreadable Content using XSSF POI 3.8, while writing to response.getOutputStream(), click here<http://apache-poi.1045710.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5710172&code=bHB1cmlAc2FwaWVudC5jb218NTcxMDE3MnwtMTE0NzY3NTM2Mw==>.
NAML<http://apache-poi.1045710.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Unreadable-Content-using-XSSF-POI-3-8-while-writing-to-response-getOutputStream-tp5710172p5710614.html
Sent from the POI - User mailing list archive at Nabble.com.