Bug 16835 - HSSFName reference setting
Summary: HSSFName reference setting
Status: RESOLVED DUPLICATE of bug 16315
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-06 10:59 UTC by Luca Billi
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Billi 2003-02-06 10:59:57 UTC
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
Comment 1 Danny Mui 2003-02-06 14:43:58 UTC
Addressed in patch: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16557

*** This bug has been marked as a duplicate of 16315 ***