Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不创建对象的写,无法正常写入数据 #1702

Closed
psxjoy opened this issue Dec 10, 2020 · 2 comments
Closed

不创建对象的写,无法正常写入数据 #1702

psxjoy opened this issue Dec 10, 2020 · 2 comments
Assignees
Labels
bug Something isn't working development completed Development completed, waiting for release pending verification This problem needs to be confirmed

Comments

@psxjoy
Copy link
Collaborator

psxjoy commented Dec 10, 2020

触发场景描述
jar包版本:2.2.6
开发环境:windows7 +IDEA 社区版

触发Bug的代码

   public void simpleWrite() {
        String fileName = TestFileUtil.getPath()+ System.currentTimeMillis() + ".xlsx";
        System.out.println(fileName);
        EasyExcel.write(fileName).head(head()).sheet("模板").doWrite(dataList());
    }
    private List<List<String>> head() {
        List<List<String>> list = new ArrayList<List<String>>();
        List<String> head0 = new ArrayList<String>();
        head0.add("表头");
        list.add(head0);
        return list;
    }
    private List<List<Object>> dataList() {
        List<List<Object>> list = new ArrayList<List<Object>>();
        List<Object> data = new ArrayList<Object>();
        data.add("字符串");
        data.add(new Date());
        data.add(0.56);
        list.add(data);
        return list;
    }

提示的异常或者没有达到的效果
按照官方文档不创建对象的写入方式,分别创建head()和dataList()函数。
按照正常的解析,生成的excel应该是:

表头
字符串 2020-12-10 15:25:17 0.56

但是测试返回的是:

表头
2020-12-10 15:25:17 0.56
@psxjoy psxjoy added the bug Something isn't working label Dec 10, 2020
@lethal233
Copy link
Contributor

请问有人在处理这个issue吗,我对这个issue感兴趣,我会在最近几个月尝试去修复这个bug。 @zhuangjiaju

@zhuangjiaju zhuangjiaju added the pending verification This problem needs to be confirmed label Apr 9, 2021
@SmireG SmireG mentioned this issue Apr 17, 2021
2 tasks
zhuangjiaju added a commit that referenced this issue Sep 16, 2021
@zhuangjiaju zhuangjiaju added the development completed Development completed, waiting for release label Sep 16, 2021
@zhuangjiaju
Copy link
Collaborator

已经在3.0.0-beta1 版本修复,beta版本会在一个月内升级成正式版。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working development completed Development completed, waiting for release pending verification This problem needs to be confirmed
Projects
None yet
Development

No branches or pull requests

3 participants