Bug 20881 - error occured in MS Excel:"Error in file: some number formats may be lost"
Summary: error occured in MS Excel:"Error in file: some number formats may be lost"
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: PC All
: P1 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-18 17:46 UTC by Pavel Janouskovec
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments
wokbook1.xls (original file), workbook2.xls (corrupt file) (6.34 KB, application/octet-stream)
2003-06-18 17:50 UTC, Pavel Janouskovec
Details
Correctly re-written file (20.50 KB, application/vnd.ms-excel)
2003-11-03 17:50 UTC, Avik Sengupta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Janouskovec 2003-06-18 17:46:01 UTC
Hello,
I have problem with HSSF component. I use MS Office 2000 (Czech localize). When 
I read and write workbook:
        POIFSFileSystem fs      =
                new POIFSFileSystem(new FileInputStream("c:\\workbook1.xls"));
        HSSFWorkbook wb = new HSSFWorkbook(fs);
        HSSFSheet sheet = wb.getSheetAt(0);
        //HSSFSheet sheet1 = wb.getSheetAt(1);
        HSSFRow row = sheet.getRow(3);
        HSSFCell cell = row.getCell((short)3);
        if (cell == null)
            cell = row.createCell((short) 2);
        cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
        cell.setCellValue(80);

        // Write the output to a file
        FileOutputStream fileOut = new FileOutputStream("workbook2.xls");
        wb.write(fileOut);
        fileOut.close();
When I open workbook2.xls in MS Excel error occured in MS Excel "Error in file: 
some number formats may be lost" and some data are losted in last sheet (I have 
two sheets in workbook- first sheet is OK, but second sheet have some data 
lost). I try use MS Excel 97, but I get same result.
Do you have any idea?
Best Regards
Pavel
Comment 1 Pavel Janouskovec 2003-06-18 17:50:19 UTC
Created attachment 6877 [details]
wokbook1.xls (original file), workbook2.xls (corrupt file)
Comment 2 Pavel Janouskovec 2003-06-19 19:23:04 UTC
I tried my code (code is in previous comment) in version poi-src-2.0-pre1-
20030517, but I have same problem. For additional, HSSF wrote messages on error 
output:
[WARNING] Unknown Ptg 12 (18) at cell (2,4)
[WARNING] Unknown Ptg 12 (18) at cell (3,4)
[WARNING] Unknown Ptg 12 (18) at cell (4,4)
[WARNING] Unknown Ptg 12 (18) at cell (5,4)
[WARNING] Unknown Ptg 12 (18) at cell (2,4)
[WARNING] Unknown Ptg 12 (18) at cell (3,4)
[WARNING] Unknown Ptg 12 (18) at cell (4,4)
[WARNING] Unknown Ptg 12 (18) at cell (5,4)
Comment 3 Andy Oliver 2003-07-24 16:55:29 UTC
We need to fix this but supporting some of the various intenational number
formats is potentially a lot of work.  We need more support from folks with
localized versions of Excel.  This is a good start.  I don't think we can do
this by 2.0 though.
Comment 4 Avik Sengupta 2003-11-03 17:49:13 UTC
Tested with 2.0RC1 and Excel2002. File opens perfectly in Excel, charts,
accented text etc all correct. 
Comment 5 Avik Sengupta 2003-11-03 17:50:41 UTC
Created attachment 8891 [details]
Correctly re-written file