if (r.getCellType()==Cell.CELL_TYPE_NUMERIC){ if(HSSFDateUtil.isCellDateFormatted(r)){ //用于转化为日期格式 Date d = r.getDateCellValue(); DateFormat formater = new SimpleDateFormat("yyyy-MM"); value = formater.format(d); }else { BigDecimal bigDecimal =…
Java之POI读取Excel的Package should contain a content type part [M1.13]] with root cause异常问题解决 引言: 在Java中,使用POI来进行excel的读取和解析是常用的一种做法:在office的excel中存在2007,2003两种不同的格式,通常情况下是以xls/xlsx的不同后缀来区分的,但用户可能不知道这个区别,所以会出现格式无法兼容的异常 1. POI POI源自Apache基金会,是其顶级域名项目, PO…
问题描述:在使用poi包进行excel解析时,发现对Excel2003以前(包括2003)的版本没有问题,但读取Excel2007时发生如下异常:org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Docu…