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

2.0.0-beta3读取03版本的excel时指定的sheet不生效,读取07版本的时正常的 #533

Closed
watilion opened this issue Sep 3, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@watilion
Copy link

watilion commented Sep 3, 2019

触发场景描述
使用quickstart中的同步结合web读取指定sheetNo和sheetName中的数据,当上传07版本的excel会正确读取到指定sheet里的数据,但是如果上传03版本的excel时却读取了全部的数据

触发Bug的代码

    private int readExcel4Other(MultipartFile file) throws IOException {
        List<Object> list = EasyExcel.read(file.getInputStream()).head(UploadData.class)
                .sheet(2,"Sheet3").doReadSync();

        log.info("解析到的数据为{}条",list.size());
        return list.size();
    }

提示的异常或者没有达到的效果
上传.xlsx后正确返回条数,但是上传.xls却是全部sheet的

@watilion watilion added the bug Something isn't working label Sep 3, 2019
@zhuangjiaju
Copy link
Collaborator

这个确实是个问题。这个 预计本周会修改这个BUG。但是2003我看兼容方式有点弱,性能会比较差,如果xls超过 10M 建议强制用户上传xlsx。 数据量小问题不大。

@zhuangjiaju
Copy link
Collaborator

已经在2.0.0-beat4 修复

@ututuut
Copy link

ututuut commented Sep 6, 2019

已经升级到2.0.0-beat4
// 可行
EasyExcel.read(fileName).sheet(2).doReadSync();
// 无效,仍然获取的是第一个sheet的数据
EasyExcel.read(fileName).sheet("Sheet2").doReadSync();

@zhuangjiaju
Copy link
Collaborator

已经升级到2.0.0-beat4
// 可行
EasyExcel.read(fileName).sheet(2).doReadSync();
// 无效,仍然获取的是第一个sheet的数据
EasyExcel.read(fileName).sheet("Sheet2").doReadSync();

这个比较复杂 暂时不支持2003根据table 名字读取。会有个warn。默认会读取第一个

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants