Giter Site home page Giter Site logo

excel-helper's People

Contributors

a634096606 avatar dependabot[bot] avatar dreamroute avatar whatakitty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

excel-helper's Issues

CacheFactory类中HEADER_INFO问题

如果第一次上传Excel文件列信息不对,HEAD_INFO中仍会创建该Class对应的headInfo信息。
导致第二次上传正确的Excel文件时抛出ExcelFormatException,抛出异常代码如下:
com.github.dreamroute.excel.helper.util.DataAssistant#createDateFromSheet方法中
while (cells.hasNext()) {
Cell cell = cells.next();
HeaderInfo headerInfo = headerInfoMap.get(cell.getColumnIndex());
if (headerInfo == null) {
throw new ExcelFormatException();
}
Field field = headerInfo.getField();
Object cellValue = getCellValue(cell, headerInfo.getCellType(), field);
try {
field.set(domain, cellValue);
} catch (IllegalArgumentException | IllegalAccessException e) {
throw new ExcelHelperException(e);
}
}
data.add(domain);
}

待增加功能

1.提供一些其他配置特性,如筛选;
2.日期目前只支持字符串,需要增加date;

能否指定写入流?

目前的应用比较局限。我想写入response就做不到了。如果加多一个方法,可以写入指定的流就好了。谢谢

poi与poi-ooxml版本不匹配无法导出

出现场景:
我的一个三方jar包中,引入了一个poi-ooxml的版本为:4.1.0,而excel-helper的poi版本为4.0.1,如下图:
image
出现错误:
在导出xlsx的时候,会导致以下错误:
image
导出xls并不会出现错误。
解决方案:
在业务应用统一指定poi-ooxml的版本。


<dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>4.1.0</version>
        </dependency>

提两个ISSUE

  • 如果数据为空,可以允许导出,但是格式损坏,无法打开
  • 如果存在excel最后几行被删除,仍旧会被识别出作为数据行的一部分,可以考虑增加一个全局配置;即,是否允许空数据行存在的情况发生

Convert Numeric type to Integer failed

The cell that has features:

  • Number value [ 12 ]
  • cell type is Numeric

caused the error: For input string: "12.0"

Why not parse int like bellow

value = new BigDecimal(cv).intValue();

instead of like that

value = Integer.valueOf(new BigDecimal(cv).toPlainString());

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.