> -----Original Message-----
> From: news [mailto:news@;main.gmane.org] On Behalf Of Andrew C. Oliver
> Sent: Friday, October 18, 2002 8:48 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: ExtenXLS Feature Matrix - compares to POI
> 
> You currently kinda can but its not "easier" (use: 
> http://jakarta.apache.org/poi/javadocs/org/apache/poi/hssf/uti
> l/CellReference.html or
> http://jakarta.apache.org/poi/javadocs/org/apache/poi/hssf/uti
> l/RangeAddress.html) ...  
> 
> There are two because to be honest I don't like the 
> RangeAddress code (maybe get26Sys means 1,1 -> B2 to someone 
> but it doesn't to me) and it is devoid of Javadoc.  I will 
> probably deprecate it and put all its functionality into 
> CellReference eventually, and refactor Named Ranges to use 
> it.  (my dislike is largely its lack of compliance with: 
> http://jakarta.apache.org/poi/resolutions/res001.html)
> 

On the other hand, RangeAddress has a lot more functionality than
CellReference; for example, you can't get the sheet name from
CellReference. Also, currently CellReference seems to be rather broken.
The following code:

int nameNum = book.getNumberOfNames();
for (int i = 0; i < nameNum; i++) {
    HSSFName namedRef = book.getNameAt(i);
    System.out.println("Cell ref = " + namedRef.getReference());
    CellReference cellRef = new CellReference(namedRef.getReference());
}

results in: 

Cell ref = Summary!$D$31
java.lang.NumberFormatException: D$31   
  at java.lang.Integer.parseInt(Integer.java:426)       
  at java.lang.Integer.parseInt(Integer.java:476)       
  at
org.apache.poi.hssf.util.CellReference.<init>(CellReference.java:82)

because it doesn't seem to be parsing the string right (it doesn't pass
over the sheet name before trying to parse row/col information out.

I can try fixing that and sending a patch but I'm not sure the row/col
info will be very useful anyway. It will map to row 30, column 3, but
isn't that information only useful in the POI API if there are no empty
rows preceding row 30?




--
To unsubscribe, e-mail:   <mailto:poi-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:poi-user-help@;jakarta.apache.org>

Reply via email to