template文件里边包含表头
FileInputStream template = new FileInputStream(System.getProperty("user.home")+"/Desktop/test5.xls");
FileOutputStream out = new FileOutputStream(System.getProperty("user.home")+"/Desktop/test6.xls");
Excels.Export()
.addSheet(datas,template)
.addSheet(datas,template)
.toStream(out);
功能样例-导入-用"格式化类"作为模板
List result = Excels.Import()
.config(new FileInputStream(System.getProperty("user.home")+"/Desktop/test1.xls"))
.addSheet(Interface2.class,0)
.addSheet(Interface2.class,1)
.addSheet(Interface2.class)
.onedata();
LogUtils.info(log,JsonUtils.objToStr(result));
功能样例-导入-用字符串title作为模板
String titles = "接口名称:name,请求url地址:url,请求参数json数据:params,参数请求类型:paramType,请求方式:requestType,期望的返回结果code:expectCode,完整的返回结果:result,价格:price";
List result = Excels.Import()
.config(new FileInputStream(System.getProperty("user.home")+"/Desktop/testone.xlsx"))
.addSheet(titles)
.onedata();
LogUtils.info(log,JsonUtils.objToStr(result));
功能样例-导入-指定列
List result = Excels.Import()
.config(new FileInputStream(System.getProperty("user.home")+"/Desktop/test1.xls"))
.addSheet(new Integer[]{1,2,3})
.onedata();
LogUtils.info(log,JsonUtils.objToStr(result));
功能样例-导入-指定行-指定列
List result = Excels.Import()
.config(new FileInputStream(System.getProperty("user.home")+"/Desktop/test1.xls"))
.addSheet(new Integer[]{2,3,4},new Integer[]{1,2,3})
.onedata();
LogUtils.info(log,JsonUtils.objToStr(result));
功能样例-导入-指定行列范围(矩阵)
List result = Excels.Import()
.config(new FileInputStream(System.getProperty("user.home")+"/Desktop/test1.xls"))
.addSheet(2,4,1,3)
.onedata();
LogUtils.info(log,JsonUtils.objToStr(result));