当我使用NPOI读取Excel工作表时,将跳过空单元格.例如,它包含行A, B, , C,我使用它读取它
IRow row = sheet.GetRow(rowNb)
Run Code Online (Sandbox Code Playgroud)
然后row.Cells[1].ToString()将输出B(按预期)但row.Cells[2].ToString()输出C而不是空字符串.有没有办法保持空单元格?谢谢.
Ric*_*ing 28
尝试使用以下GetCell方法MissingCellPolicy:
ICell cell = row.GetCell(2, MissingCellPolicy.RETURN_NULL_AND_BLANK);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6976 次 |
| 最近记录: |