jeecgboot / autopoi

AutoPOI 功能如同名字auto,追求的就是自动化,让一个没接触过poi的人员,可以傻瓜化的快速实现Excel导入导出、Word模板导出、可以仅仅5行代码就可以完成Excel的导入导出。
http://www.jeecg.com
Apache License 2.0
460 stars 199 forks source link

ExcelImportUtil.importExcelBySax导入数据解析不到数据 #85

Closed Evan98521 closed 8 months ago

Evan98521 commented 1 year ago

ExcelImportUtil.importExcelBySax,使用importExcelBySax导入数据解析不到数据,得到的list数据是空的。

public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response, Class<Uers> clazz) throws Exception  { 
  MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;         
  Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();     
  for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {             
    MultipartFile file = entity.getValue();         
    ImportParams params = new ImportParams();         
    params.setTitleRows(1);          
    params.setHeadRows(1);           
    params.setNeedSave(true);          
    List<Uers> list = ExcelImportUtil.importExcelBySax(file.getInputStream(), clazz, params);
nowtostudeyday commented 9 months ago

我也存在这个问题,使用inportExcel()可以正常导入,但是使用inportExcelBySax()就无法获取到数据

EightMonth commented 9 months ago

ImportParams需要设置SheetNum,否则是读取0行 /**

nowtostudeyday commented 9 months ago

好的,谢谢!

1375932459 @.***

 

------------------ 原始邮件 ------------------ 发件人: "jeecgboot/autopoi" @.>; 发送时间: 2023年11月23日(星期四) 中午1:01 @.>; @.**@.>; 主题: Re: [jeecgboot/autopoi] ExcelImportUtil.importExcelBySax导入数据解析不到数据 (Issue #85)

ImportParams需要设置SheetNum,否则是读取0行 /**

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>