I am using the latest stable version of apache poi jars to create xls files using a servlet.
I am able to save the xls to the disk . Howeve when I try to open this file xls crashes and comes up with error report. Next Excel autorepairs the document and opens the sheet which does not have any format
i created. The data is intact though.
If that's the sort of code we're talking about, then it would be a good idea if you could produce an SSCCE which exhibits your problem. (Follow the link, read the document it leads to.) The code you posted is not enough for us to work with because it doesn't show how you write the data to the file. But it shouldn't be hard for you to expand it to an SSCCE which we can work with.
posted 7 years ago
The error was due to the way I was streaming the output.
I was coinverting the HSSFWorkbook output as bytes using its getBytes() method which was causing some data format and encoding to be lost.
Then instead I wrote the workbook object directly to the servlet stream as
This fixed it.
Thanks for the inputs.
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad: