POI Excel 03 (二)

2014-11-24 08:41:48 · 作者: · 浏览: 1
//根据Workbook对象得到工作薄
Sheet sheet = wb.getsheetat(0);
//得到行迭代器,遍历所有行
for (iterator rit = sheet.rowiterator(); rit.hasnext(); ) {
//得到行对象
Row row = rit.next();
//根据行对象得到所有的单元格,遍历所有单元格
for (iterator cit = row.celliterator(); cit.hasnext(); ) {
//得到该单元格
Cell cell = cit.next();
// 你需要实现功能的代码...
}
}


作者:yhc13429826359