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 2008/07/18 11:28:15 UTC

DO NOT REPLY [Bug 45430] New: XSSFName.getSheetName() returns the wrong value

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

           Summary: XSSFName.getSheetName() returns the wrong value
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: matthew.knl@gmail.com


Created an attachment (id=22279)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22279)
Test Data

I am using POI 3.5 Beta 1.
I write following code to list all the Named Range in the Excel Workbook.

Workbook wb = new XSSFWorkbook(xlsx_path);
for(int j=0; j<wb.getNumberOfNames(); j++){
        Name name = wb.getNameAt(j);                            
        String reference = name.getReference();
        String sheetName = name.getSheetName();
        System.out.println("reference: " + reference);
        System.out.println("sheetName: " + sheetName);
}

I found that the .getSheetName() method return the wrong value, it always
return sheet one name, which doesn't match with .getReference() (the sheet name
part).

I have uploaded a sample .xlsx file, which contains three worksheets, each
worksheet $A$1 has defined a named range. You can run above codes to check the
result.

Expected Result:
reference: SheetA!$A$1
sheetName: SheetA
reference: SheetB!$A$1
sheetName: SheetB
reference: SheetC!$A$1
sheetName: SheetC

Actual Result:
reference: SheetA!$A$1
sheetName: SheetA
reference: SheetB!$A$1
sheetName: SheetA
reference: SheetC!$A$1
sheetName: SheetA


-- 
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 45430] XSSFName.getSheetName() returns the wrong value

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





--- Comment #5 from Matthew <ma...@gmail.com>  2008-07-20 18:57:29 PST ---
(In reply to comment #3)
> Created an attachment (id=22288)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22288) [details]
> My patch to solve "save macro-enabled workbook" issue, temporary solution
> 

Sorry, this attachment is should be referred to bug#45430.


-- 
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 45430] XSSFName.getSheetName() returns the wrong value

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





--- Comment #4 from Matthew <ma...@gmail.com>  2008-07-20 18:57:08 PST ---
(In reply to comment #2)
> Created an attachment (id=22287)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22287) [details]
> Macro-enabled workbook package structure
> 

Sorry, this attachment is should be referred to bug#45430.


-- 
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 45430] XSSFName.getSheetName() returns the wrong value

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





--- Comment #3 from Matthew <ma...@gmail.com>  2008-07-20 18:50:31 PST ---
Created an attachment (id=22288)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22288)
My patch to solve "save macro-enabled workbook" issue, temporary solution


-- 
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 45430] XSSFName.getSheetName() returns the wrong value

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


Nick Burch <ni...@torchbox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Nick Burch <ni...@torchbox.com>  2008-07-18 10:37:49 PST ---
Fixed in svn - was an issue when no localSheetId was given


-- 
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 45430] XSSFName.getSheetName() returns the wrong value

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





--- Comment #2 from Matthew <ma...@gmail.com>  2008-07-20 18:49:16 PST ---
Created an attachment (id=22287)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22287)
Macro-enabled workbook package structure


-- 
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