Skip to content

Commit

Permalink
修复xls仅公式行 不读取的bug #1324
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuangjiaju committed May 25, 2020
1 parent 84998e9 commit 58fdceb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.alibaba.excel.constant.BuiltinFormats;
import com.alibaba.excel.context.xls.XlsReadContext;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.enums.RowTypeEnum;
import com.alibaba.excel.metadata.Cell;
import com.alibaba.excel.metadata.CellData;

Expand Down Expand Up @@ -43,6 +44,7 @@ public void processRecord(XlsReadContext xlsReadContext, Record record) {
}
tempCellData.setFormula(Boolean.TRUE);
tempCellData.setFormulaValue(formulaValue);
xlsReadContext.xlsReadSheetHolder().setTempRowType(RowTypeEnum.DATA);
switch (cellType) {
case STRING:
// Formula result is a string
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public class Lock2Test {

@Test
public void test() throws Exception {
File file = TestFileUtil.readUserHomeFile("test/test.xlsx");
File file = TestFileUtil.readUserHomeFile("test/test4.xlsx");

List<Object> list = EasyExcel.read(file).ignoreEmptyRow(true).sheet().headRowNumber(0).doReadSync();
List<Object> list = EasyExcel.read(file).sheet().headRowNumber(0).doReadSync();
LOGGER.info("数据:{}", list.size());
for (Object data : list) {
LOGGER.info("返回数据:{}", JSON.toJSONString(data));
Expand Down
2 changes: 1 addition & 1 deletion update.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 写入`sheet`不设置`index``name`默认不为0的问题
* 修复多个`sheet`不按照顺序写入 会乱序的bug [Issue #1332](https://github.com/alibaba/easyexcel/issues/1332)
* 修改head是List时,内容单元格的样式不生效 [Issue #1339](https://github.com/alibaba/easyexcel/issues/1339)
* 新增写入`class``list`同时传入 `field`数量不一致报错 [Issue #1333](https://github.com/alibaba/easyexcel/issues/1333)
* 修复xls仅公式行 不读取的bug [Issue #1324](https://github.com/alibaba/easyexcel/issues/1324)


# 2.2.3
Expand Down

0 comments on commit 58fdceb

Please sign in to comment.