You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by James Geroge <ja...@gmail.com> on 2010/04/15 20:43:37 UTC

How to get the Cell Number from POI 3.5

Hi Friends,
I am trying to way to get the cellnumber from POI 3.5.
in 2.5 (HSSFCell) there was method named cell.getCellNum() which returns the
cell number, but in 3.5 i did not see that method, please help

Thanks
James George
-- 
View this message in context: http://old.nabble.com/How-to-get-the-Cell-Number-from-POI-3.5-tp28259150p28259150.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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


Re: How to get the Cell Number from POI 3.5

Posted by MSB <ma...@tiscali.co.uk>.
Googled whilst waiting for the tea to mash and found this in the javadoc;

getCellNum

public short getCellNum()

    Deprecated. (Oct 2008) use getColumnIndex()

So, there is your answer, use the getColumnIndex() method instead.

Yours

Mark B


James Geroge wrote:
> 
> Hi Friends,
> I am trying to way to get the cellnumber from POI 3.5.
> in 2.5 (HSSFCell) there was method named cell.getCellNum() which returns
> the cell number, but in 3.5 i did not see that method, please help
> 
> Thanks
> James George
> 

-- 
View this message in context: http://old.nabble.com/How-to-get-the-Cell-Number-from-POI-3.5-tp28259150p28263814.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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


Re: How to get the Cell Number from POI 3.5

Posted by James Geroge <ja...@gmail.com>.
Hi Mark,
Thanks for the detailed note, I was able to resolve my issue by using the
method getColumnIndex() of the cell.

Regards,
James George.


MSB wrote:
> 
> Hello James,
> 
> I am not at all familiar with such an old version of POI - 2.5 - so can I
> ask please, what exactly did the getCellNum() method return?
> 
> The co-ordinates of a cell are usually the product of the column and the
> row it sits in. When you recover a cell using POI, the typical idiom is to
> get a row from a sheet using an index and then to get a cell from the row
> also using an index. Thus, the cell's number is the pair of co-ordinates -
> row and column index - that you use to obtain it in the first place. If
> you are after the cells index in Excel's format then there is a support
> calss that will convert from the row and column index into that format be
> it A1, X35 of whatever. Take a look here -
> http://poi.apache.org/apidocs/org/apache/poi/ss/util/CellReference.html -
> CellReference allows you to convert from the column and row indices used
> to refer to cell in POI to it's Excel equivalent.
> 
> Do not know if this helps at all as I am not familiar with 2.5 and the
> getCellNum() method. If not, then can you explain what that method did and
> it should be possible to convery from one value into another.
> 
> Yours
> 
> Mark B
> 
> 
> James Geroge wrote:
>> 
>> Hi Friends,
>> I am trying to way to get the cellnumber from POI 3.5.
>> in 2.5 (HSSFCell) there was method named cell.getCellNum() which returns
>> the cell number, but in 3.5 i did not see that method, please help
>> 
>> Thanks
>> James George
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-get-the-Cell-Number-from-POI-3.5-tp28259150p28268004.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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


Re: How to get the Cell Number from POI 3.5

Posted by MSB <ma...@tiscali.co.uk>.
Hello James,

I am not at all familiar with such an old version of POI - 2.5 - so can I
ask please, what exactly did the getCellNum() method return?

The co-ordinates of a cell are usually the product of the column and the row
it sits in. When you recover a cell using POI, the typical idiom is to get a
row from a sheet using an index and then to get a cell from the row also
using an index. Thus, the cell's number is the pair of co-ordinates - row
and column index - that you use to obtain it in the first place. If you are
after the cells index in Excel's format then there is a support calss that
will convert from the row and column index into that format be it A1, X35 of
whatever. Take a look here -
http://poi.apache.org/apidocs/org/apache/poi/ss/util/CellReference.html -
CellReference allows you to convert from the column and row indices used to
refer to cell in POI to it's Excel equivalent.

Do not know if this helps at all as I am not familiar with 2.5 and the
getCellNum() method. If not, then can you explain what that method did and
it should be possible to convery from one value into another.

Yours

Mark B


James Geroge wrote:
> 
> Hi Friends,
> I am trying to way to get the cellnumber from POI 3.5.
> in 2.5 (HSSFCell) there was method named cell.getCellNum() which returns
> the cell number, but in 3.5 i did not see that method, please help
> 
> Thanks
> James George
> 

-- 
View this message in context: http://old.nabble.com/How-to-get-the-Cell-Number-from-POI-3.5-tp28259150p28263575.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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