Bug 45725 - Dialog box "File error: Data has been lost error" appears while opening a file by POI and saving it
Summary: Dialog box "File error: Data has been lost error" appears while opening a fil...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-FINAL
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: ErrorMessage
Depends on:
Blocks:
 
Reported: 2008-09-02 02:57 UTC by Grégory PAUL
Modified: 2009-04-17 11:47 UTC (History)
0 users



Attachments
Input excel file which contains a pivot table and a chart (88.00 KB, application/vnd.ms-excel)
2008-09-02 02:57 UTC, Grégory PAUL
Details
Java example file (742 bytes, text/x-java)
2008-09-02 02:58 UTC, Grégory PAUL
Details
Excel output file which shows the "file error" error dialog box (136.00 KB, application/vnd.ms-excel)
2008-09-02 02:59 UTC, Grégory PAUL
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Grégory PAUL 2008-09-02 02:57:40 UTC
Created attachment 22508 [details]
Input excel file which contains a pivot table and a chart

I'm using POI 3.1.
I am simply opening an excel file containing a pivot table and a chart and directly saving it, without any other action.

Then when I try to open that file, the dialog box "File error: Data has been lost error" appears even if the file is correct.

See excel input file (basefile.xls), ouput file (output.xls) and the Java example file (PoiDemoFileError.java) attached in that bug.

Grégory
Comment 1 Grégory PAUL 2008-09-02 02:58:09 UTC
Created attachment 22509 [details]
Java example file
Comment 2 Grégory PAUL 2008-09-02 02:59:13 UTC
Created attachment 22510 [details]
Excel output file which shows the "file error" error dialog box
Comment 3 Michael Zalewski 2008-09-07 22:51:09 UTC
This spreadsheet contains a ChartSheet (a sheet with no rows or columns, just a chart).

POI cannot deal with ChartSheets. POI assumes every sheet in thw workbook is a worksheet (which is the most common type of sheet). To fix the problem, remove the chartsheet, and insert the chart onto a worksheet.

POI also cannot deal with DialogSheets, which also have no rows or columns, just a VBA form. A fourth type of sheet also exists, which is called a macrosheet. POI can handle that type of sheet sometimes. But I have found macrosheets sometimes contain older formats of BIFF records, which causes problems with some versions of POI.
Comment 4 Grégory PAUL 2008-09-24 00:44:33 UTC
(In reply to comment #3)

Thanks for the workaround. I'll try that.

However, that's still a bug (that the dialog appears if a workbook contains other sheets than worksheets), isn't it ?
Comment 5 Grégory PAUL 2008-09-24 07:53:25 UTC
(In reply to comment #3)
> To fix the problem, remove
> the chartsheet, and insert the chart onto a worksheet.

Yes, removing the chartsheet works and avoid the error dialog box.
Thanks for that tips.
Comment 6 Yegor Kozlov 2009-04-17 11:47:01 UTC
The problem is not reproducible with trunk.  

Please try the latest svn version .
Daily builds are available at
http://encore.torchbox.com/poi-svn-build/

Regards,
Yegor