You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/09/03 08:51:32 UTC

DO NOT REPLY [Bug 49874] New: Problems with names when removing a sheet from an HSSF workbook

https://issues.apache.org/bugzilla/show_bug.cgi?id=49874

           Summary: Problems with names when removing a sheet from an HSSF
                    workbook
           Product: POI
           Version: 3.7-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: martin.studer@mirai-solutions.com


Created an attachment (id=25979)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25979)
Zip file with the mentioned workbooks (Test.xls and Test.xlsx)

I have an Excel file with three sheets called AAA, BBB, CCC. On each of them
there is a name defined: AA on AAA, BB on BBB, CC on CCC. If I'm now removing
sheet BBB, the behaviour for a HSSF workbook is different than for a XSSF
workbook. The following is what I observe:

- HSSF: Sheets AAA and CCC remain (which is ok), but left are only names AA and
BB. This is strange. I would understand if BB would be missing but CC should
definitely still be around I guess. Also, if you open the file with an older
version of Excel (< 2007) you are confronted with a dialog saying that the file
has been repaired. Excel 2007+ seems to do that behind the scenes.

- XSSF: Sheets AAA and CCC remain (again, this is ok), and so do the names AA
and CC. This behaviour seems ok to me.

Please find a snippet of code that can be used to reproduce the problem:


Workbook wb = WorkbookFactory.create(new
FileInputStream("C:/Users/mstuder/Documents/Test.xls"));
wb.removeSheetAt(wb.getSheetIndex("BBB"));
wb.write(new FileOutputStream("C:/Users/mstuder/Documents/Test2.xls"));

Also, please find attached the two corresponding Excel files (*.xls and
*.xlsx).

OS: Windows 7
POI: 3.7-beta2
Java: 1.6.0_20 64-bit

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 49874] Problems with names when removing a sheet from an HSSF workbook

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49874

awm@mbcli.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME
         OS/Version|                            |All

--- Comment #1 from awm@mbcli.com 2010-12-23 20:19:00 EST ---
As of last night's trunk AA, BB, and CC all appear in xlsx version after BBB is
deleted.  I didn't try the OLE2.

I think leaving the BB named range is the proper outcome.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org