myeclipse如何创建xls表
1.下载poi相关的jar
2.解压并将相关的jar包引入项目。excel 2010使用以XSSH开头的相关包,相关类在相关jar包中,其名称包含OOXML。
3.下面是一个简单的例子
导入Java . io . bufferedinputstream;
导入Java . io . file;
导入Java . io . file inputstream;
import Java . io . filenotfoundexception;
导入Java . io . io exception;
导入Java . text . decimal format;
导入Java . text . simple date format;
导入Java . util . ArrayList;
导入Java . util . arrays;
导入Java . util . date;
导入Java . util . list;
导入org . Apache . poi . hssf . user model . hssfdateutil;
导入org . Apache . poi . xssf . user model . xssf cell;
导入org . Apache . poi . xssf . user model . XSS flow;
导入org . Apache . poi . xssf . user model . xssf sheet;
导入org . Apache . poi . xssf . user model . xssf workbook;
公共类excel 2010操作{
公共静态void main(String[] args)引发异常{
//File File = new File(" src \ \ excelResourceFile \ \ privilege . xlsx ");
File File = new File(" src \ \ exceluser File \ \ exceluser File . xlsx ");
excel 2010 operation excel = new excel 2010 operation();
列表& gtworkBook = excel.getData(file," all ",0);
for(列表工作表:工作簿){
for (String[] row : sheet) {
for(int col = 0;col & ltrow.lengthcol++) {
system . out . print(row[col]+" \ t ");
}
system . out . println();
}
system . out . println();
system . out . println("……………………一页读取结束………………………………");
system . out . println();
}
}