DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16835>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16835

HSSFName reference setting

           Summary: HSSFName reference setting
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I'm playing with POI HSSF and I'm using the jakarta-poi-1.9.0-dev-20030122 
version instead of release 1.5.1 because I need formulas support.
I've experimented some problems setting reference string in a newly created 
HSSFName. Querying your Bugzilla I found other similar issues. The problem I 
had is just described in bug 16411. But the "answer" was in bug 16315 
description. The actual behaviour is the following:

A reference like sheetName!$B$2:$E$6 appear to be wrongly parsed.
Instead sheetName.$B$2:$E$6 works.

I append a chunk of code illustrating these issues

        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet("MySheet");
        HSSFName name = wb.createName();
        name.setNameName("MyArea");
        name.setReference("MySheet!$B$2:$E$6");
        System.out.println(name.getReference());
//        System.out.println(name.getSheetName()); // This line would produce 
NullPointerException
        name.setReference("MySheet.$B$2:$E$6");
        System.out.println(name.getReference());
        System.out.println(name.getSheetName());

The output of this chunk is

null!$IU$2:$E$6
MySheet!$B$2:$E$6
MySheet

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to