Bug 44866 - Problem with office SP3.
Summary: Problem with office SP3.
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.0-dev
Hardware: Other Windows XP
: P1 critical with 1 vote (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2008-04-24 03:04 UTC by Deepak Lokhande
Modified: 2008-04-28 07:50 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Lokhande 2008-04-24 03:04:27 UTC
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.
Comment 1 Josh Micich 2008-04-24 16:27:00 UTC
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.
Comment 2 Deenar Toraskar 2008-04-28 07:07:19 UTC
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 

The XLS files generated work fine with Excel versions without this patch.

Deenar Toraskar
Comment 3 Nick Burch 2008-04-28 07:22:16 UTC
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!
Comment 4 Deenar Toraskar 2008-04-28 07:44:04 UTC
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.
Comment 5 Nick Burch 2008-04-28 07:50:03 UTC
Good to know it's fixed