We are creating the Excel report, Report gets open fine in case of Office sp2, but with office SP3 following msg gets when we open the excel report. " Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted." We can see all the data but the fonts, colors and formula vanished. To create the report following steps are performed 1. Get the template to generate the template. fs = new POIFSFileSystem(new FileInputStream(servlet.getServletContext().getRealPath("/") + tPath + "//TestReport.xls")); 2. Create Work book wb = new HSSFWorkbook(fs); 3. HSSFSheet sheet = wb.getSheet(name); // name = here name of sheet present in template HSSFRow row = sheet.getRow(4); HSSFCell cell = row.getCell(4); if (cell == null) { cell = row.createCell(4); } setCell(cell, "Data to print in report."); and wb object is set in request attribute and use to open excel report.
I assume that 'wb' was written out to file, and *that* is the file that doesn't open properly in Excel. It's likely that the 'template' file TestReport.xls has a lot to do with this bug (the snippets of java code you supplied look very normal). Could you please upload that file and some exact java code which produces this error? BTW if TestReport.xls was produced in another utility besides Excel (or in any case) it may help to re-save that file with Excel first before manipulating it with POI.
I can confirm that our users are reporting the same issue. I cannot post code snippets. Our application generates XLS output from scratch, without using a template file. "Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted." This behaviour is only seen with desktops where SP3 applied to Excel or specifically this excel patch http://www.microsoft.com/technet/security/Bulletin/MS08-014.mspx The XLS files generated work fine with Excel versions without this patch. Regards Deenar Toraskar
Could someone please either post: * a file that will open on SP2 but not SP3 * some code that generates the file that opens on SP2 but not on SP3 (in either case, ideally the smallest code snippet/file that will trigger it) Without that, we've no way to tell what's wrong. In the mean time though, you might be best of ringing up Microsoft tech support (support contracts ought to have some use...), and asking them what they broke in SP3!
Update - This problem is fixed using 3.0.2-FINAL version of POI. We were previously using 3.0-FINAL version. No sure wether to mark it as resolved.
Good to know it's fixed