简体   繁体   中英

Alternative to POI's getCellNum method

I am working on a legacy system that uses the getCellNum method in

<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version> 

its usage:

private void setValue(BpShipment entity, HSSFCell cell) {
    if (cell != null) {
        int cnum = cell.getCellNum(); // not found error
        // the rest of the code

When I started using the newer POI version on some new code

<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>

I started having an error in the legacy code saying that getCellNum() can't be resolved. Does any one know what is the replacement for getCellNum in the newer POI versions ?

Note:

Both legacy code class and new code class exist in the same maven project, so I can only use one of the POI dependencies, or can I use both? Thanks.

It's listed in thedeprecated list :

org.apache.poi.hssf.usermodel.HSSFCell.getCellNum( ) (Oct 2008) use HSSFCell.getColumnIndex()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM