Prepare for NPOI upgrade.
This commit is contained in:
@@ -90,6 +90,7 @@ namespace Sarand.Net.Standard.Proc.Excel
|
||||
catch
|
||||
{
|
||||
// If reading fails, try to read workbook as XLS:
|
||||
fs.Seek(0, SeekOrigin.Begin);
|
||||
workbook = new HSSFWorkbook(fs);
|
||||
}
|
||||
}
|
||||
@@ -127,6 +128,7 @@ namespace Sarand.Net.Standard.Proc.Excel
|
||||
catch
|
||||
{
|
||||
// If reading fails, try to read workbook as XLS:
|
||||
workbookStream.Seek(0, SeekOrigin.Begin);
|
||||
workbook = new HSSFWorkbook(workbookStream);
|
||||
}
|
||||
}
|
||||
@@ -268,8 +270,8 @@ namespace Sarand.Net.Standard.Proc.Excel
|
||||
SetErrorState(Msg_WorkbookNotOpen);
|
||||
if (!HasErrorState())
|
||||
{
|
||||
for (int sheetPos = 1; sheetPos <= workbook.NumberOfSheets; sheetPos++)
|
||||
names.Add(workbook.GetSheetName(sheetPos));
|
||||
for (int sheetIdx = 0; sheetIdx < workbook.NumberOfSheets; sheetIdx++)
|
||||
names.Add(workbook.GetSheetName(sheetIdx));
|
||||
}
|
||||
return new List<String>(names);
|
||||
}
|
||||
@@ -786,7 +788,7 @@ namespace Sarand.Net.Standard.Proc.Excel
|
||||
}
|
||||
private bool IsCellDate(ICell cell)
|
||||
{
|
||||
return cell != null && NPOI.SS.UserModel.DateUtil.IsCellDateFormatted(cell);
|
||||
return IsCellNumeric(cell) && NPOI.SS.UserModel.DateUtil.IsCellDateFormatted(cell);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user