ASF Bugzilla – Attachment 31723 Details for
Bug 56635
Wrong getLastCellNum returns wrong result when deleting cells in Excel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test Application
LastCellNum.java (text/plain), 1.27 KB, created by
Simon
on 2014-06-17 14:15:56 UTC
(
hide
)
Description:
Test Application
Filename:
MIME Type:
Creator:
Simon
Created:
2014-06-17 14:15:56 UTC
Size:
1.27 KB
patch
obsolete
>import java.io.File; >import java.io.IOException; > >import org.apache.poi.openxml4j.exceptions.InvalidFormatException; >import org.apache.poi.ss.usermodel.Cell; >import org.apache.poi.ss.usermodel.Row; >import org.apache.poi.ss.usermodel.Sheet; >import org.apache.poi.ss.usermodel.Workbook; >import org.apache.poi.ss.usermodel.WorkbookFactory; > > >public class CellCount { > > > public CellCount(){ > File excelFile = new File("c:/temp/ETH_template.xls"); > Workbook wb = null; > try { > wb = WorkbookFactory.create(excelFile); > } catch (InvalidFormatException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (IOException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > Sheet sheet = wb.getSheet("samplelist"); > Row row = sheet.getRow(19); > short minColIx = row.getFirstCellNum(); > short maxColIx = row.getLastCellNum(); > for(short colIx=minColIx; colIx<maxColIx; colIx++) { > Cell cell = row.getCell(colIx); > if(cell == null) { > System.out.println("Cell " + colIx + " is null"); > continue; > } > System.out.println("Cell type " + colIx + " is " + cell.getCellType()); > } > } > > /** > * @param args > */ > public static void main (String[] args) > { > new CellCount(); > > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 56635
:
31722
| 31723