jeecgboot / autopoi

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

AutoPoi ExcelExportUtil参数填写问题? #1

Open LiuNet2 opened 5 years ago

LiuNet2 commented 5 years ago

Jar包中 /**

我引用 return ExcelExportUtil.exportExcel(sheetsList, "HSSF"); 程序执行总是报错,后来发现,第二个参数 String type的值 虽然写着“HSSF”,但是

执行 ExcelType.HSSF.equals(type)的结果却是 false; 请帮忙看下,type 的值该如何些,我需要函数体内 执行的是

workbook = new HSSFWorkbook();


附:

在easypoi中,exportExcel是这样定义的

/**

easypoi中第二个参数是ExcelType type,不是String格式的,

CowSmiles commented 5 years ago

这是个枚举类型,直接用ExcelType.HSSF就好了

LiuNet2 commented 5 years ago

这是个枚举类型,直接用ExcelType.HSSF就好了

不是的,你看下Jar包中, AutoPoi 写的是

public static Workbook exportExcel(List<Map<String, Object>> list, String type) {

在easypoi中,exportExcel是这样定义的 public static Workbook exportExcel(List<Map<String, Object>> list, ExcelType type) {

CowSmiles commented 5 years ago

直接用ExportParams呢?

On Tue, Jun 18, 2019 at 7:06 PM LiuNet2 notifications@github.com wrote:

这是个枚举类型,直接用ExcelType.HSSF就好了

不是的,你看下Jar包中, AutoPoi 写的是 public static Workbook exportExcel(List<Map<String, Object>> list, String type) {

在easypoi中,exportExcel是这样定义的 public static Workbook exportExcel(List<Map<String, Object>> list, ExcelType type) {

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zhangdaiscott/autopoi/issues/1?email_source=notifications&email_token=AAHYWSTGVWAPN6AP3ANIE4LP3C6TRA5CNFSM4HN2CZP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX6AW4Y#issuecomment-503057267, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHYWSXJ4Q2VLF4CMLFDJY3P3C6TRANCNFSM4HN2CZPQ .

tygithub1 commented 4 years ago

是的不能比较, 字符串和枚举怎么比较