Java poi导入Excel

2021-09-23 11:13

阅读:781

标签:ber   original   tle   common   rop   ima   color   last   list    public MessageTo importPartyMember(MultipartFile file) { try { InputStream is = file.getInputStream(); Workbook hssfWorkbook = null; if (file.getOriginalFilename().endsWith("xlsx")){ hssfWorkbook = new XSSFWorkbook(is);//Excel 2007 }else if (file.getOriginalFilename().endsWith("xls")){ hssfWorkbook = new HSSFWorkbook(is);//Excel 2003 } Sheet hssfSheet = hssfWorkbook.getSheetAt(0); String titleformat = "姓名,性别,出生年月,身份证,学历,电子邮箱,入党时间,所属党组织,性质,"; String title = ""; Row firstRow = hssfSheet.getRow(0); for (int j = 0; j


评论


亲,登录后才可以留言!