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

获取单元格的类型不准确 #4087

Open
Sunshine-KK opened this issue Feb 14, 2025 · 0 comments
Open

获取单元格的类型不准确 #4087

Sunshine-KK opened this issue Feb 14, 2025 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@Sunshine-KK
Copy link

获取单元格的类型不准确

现在将表格的某一列单元格类型设置为了文本,这一列的数据都是 102这种数字,执行下面的代码:
'''
public static class ArrayDataListener extends AnalysisEventListener<Map<Integer, String>> {

    @Override
    public void invokeHead(Map<Integer, ReadCellData<?>> headMap, AnalysisContext context) {
        log.info("解析到一条头数据:{}", JSON.toJSONString(headMap));
        for (Integer key : headMap.keySet()) {
            ReadCellData cellData = headMap.get(key);
            System.out.println(cellData.getStringValue() + ":" + cellData.getType().name());
        }
    }


    @Override
    public void invoke(Map<Integer, String> dataMap, AnalysisContext analysisContext) {
        return;
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
    }
}

'''
输出接口是STRING

请问easyexcel对于单元格的类型是根据数据内容来推断的吗?

@Sunshine-KK Sunshine-KK added the help wanted Extra attention is needed label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant