/**
*
* @param fileName execl文件生成的位置
* @param data 数据
*/
public void Execl(String sheetName,String fileName,List<List<Object>> data){
try {
List<String> headerList = Lists.newArrayList();
headerList.add("name");
headerList.add("dept");
headerList.add("political");
headerList.add("level");
headerList.add("tel");
Workbook workBook = ExcelUtil.createWorkBook(headerList, data, new StringBuffer(sheetName), true, true);
File file = new File(fileName);
FileOutputStream outputStream = new FileOutputStream(file);
workBook.write(outputStream);
workBook.close();
}catch (Exception e){
e.printStackTrace();
}
}
excel的包可以用easyexcel,我用的是我们自己的包