java POI的操作 本帖最后由 hao1314 于 2011-04-26 22:30:35 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你所谓的别名是什么意思??? 在Excel手动做个Demo贴出图来 package SwingDeo;import java.util.*;import org.apache.poi.xssf.usermodel.XSSFCell;import org.apache.poi.xssf.usermodel.XSSFRow;import org.apache.poi.xssf.usermodel.XSSFSheet;import org.apache.poi.xssf.usermodel.XSSFWorkbook;public class PoiService { private String strPath; public PoiService(String strPath) { this.strPath = strPath; } public List<String> getSheetCellValues() throws Exception { ArrayList<String> list = new ArrayList<String>(); XSSFWorkbook xwb = new XSSFWorkbook(strPath); XSSFSheet xSheet = xwb.getSheet("Sheet1"); // Row for (int rowNum = 0; rowNum <= xSheet.getLastRowNum(); rowNum++) { XSSFRow xRow = xSheet.getRow(rowNum); if (xRow == null) { continue; } // Cell XSSFCell xCell = xRow.getCell(1); if (xCell == null) { continue; } if (xCell.getCellType() == XSSFCell.CELL_TYPE_STRING) { String s = xCell.getRowIndex()+Integer.parseInt("1")+": "+xCell.getStringCellValue(); list.add(s); } } return list; }} 新手 求帮助啊 高手们快来啊 生成隐藏的验证码 webservice AJAX/JSP 关于服务端返回中文乱码的问题………… jsp 请告诉我, 我已有一个用来针对sqlserver数据库创建的sql脚本文件,如何快速地得到针对oracle的sql脚本文件?? 成都软件开发方面的工作好找不,想到成都去有点急,没有什么太多的工作经验 关于JSP的开发!! jspsmartupdate中写入oracle的blob的问题,help me 运行jsp页面时出现的警告,是语法错误还是?大神指点 SSH整合的问题 关于EXTJS疑问
import java.util.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class PoiService {
private String strPath;
public PoiService(String strPath) {
this.strPath = strPath;
}
public List<String> getSheetCellValues() throws Exception {
ArrayList<String> list = new ArrayList<String>();
XSSFWorkbook xwb = new XSSFWorkbook(strPath);
XSSFSheet xSheet = xwb.getSheet("Sheet1");
// Row
for (int rowNum = 0; rowNum <= xSheet.getLastRowNum(); rowNum++) {
XSSFRow xRow = xSheet.getRow(rowNum);
if (xRow == null) {
continue;
}
// Cell
XSSFCell xCell = xRow.getCell(1);
if (xCell == null) {
continue;
}
if (xCell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
String s = xCell.getRowIndex()+Integer.parseInt("1")+": "+xCell.getStringCellValue();
list.add(s);
}
}
return list;
}
}