This commit is contained in:
Looly 2022-09-30 18:40:03 +08:00
parent 6bde21ff4a
commit 665ba76f98
2 changed files with 15 additions and 1 deletions

View File

@ -46,7 +46,8 @@ public class MapSheetReader extends AbstractSheetReader<List<Map<String, Object>
} else if (headerRowIndex > lastRowNum) {
throw new IndexOutOfBoundsException(StrUtil.format("Header row index {} is greater than last row index {}.", headerRowIndex, lastRowNum));
} else if (startRowIndex > lastRowNum) {
throw new IndexOutOfBoundsException(StrUtil.format("startRowIndex row index {} is greater than last row index {}.", startRowIndex, lastRowNum));
// issue#I5U1JA 只有标题行的Excel起始行是1标题行最后的行号是0
return ListUtil.empty();
}
final int startRowIndex = Math.max(this.startRowIndex, firstRowNum);// 读取起始行包含
final int endRowIndex = Math.min(this.endRowIndex, lastRowNum);// 读取结束行包含

View File

@ -0,0 +1,13 @@
package cn.hutool.poi.excel;
import org.junit.Ignore;
import org.junit.Test;
public class IssueI5U1JATest {
@Test
@Ignore
public void readAllTest() {
final ExcelReader reader = ExcelUtil.getReader("d:/test/issueI5U1JA.xlsx");
reader.readAll();
}
}