Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="NPOI" Version="2.7.5" />
<PackageVersion Include="NPOI" Version="2.7.6" />
<PackageVersion Include="NLog" Version="6.1.1" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.1.7" />
Expand Down
17 changes: 5 additions & 12 deletions Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ public DataTable GetAllData(ISheet worksheet, IDataLoadEventListener listener, i
var toReturn = new DataTable();
toReturn.BeginLoadData();

var rowEnumerator = worksheet.GetRowEnumerator();
var rowEnumerator = worksheet.GetEnumerator();
var nColumns = -1;

var nonBlankColumns = new Dictionary<int, DataColumn>();

while (rowEnumerator.MoveNext())
{
var row = (IRow)rowEnumerator.Current;
var row = rowEnumerator.Current;
if (rowOffset - 1 > row.RowNum) continue;// .RowNumber is 0 indexed

//if all the cells in the current row are blank skip it (eliminates top of file whitespace)
Expand Down Expand Up @@ -246,21 +246,16 @@ private static string GenerateASCIIArtOfSubstitutions(string[] headers,
/// <param name="cell">The cell whose value you want to retrieve</param>
/// <param name="treatAs">Leave blank, used in recursion for dealing with Formula cells</param>
/// <returns></returns>
private object GetCellValue([CanBeNull] ICell cell, CellType treatAs = CellType.Unknown)
private object GetCellValue([CanBeNull] ICell cell, CellType? treatAs = null)
{
if (cell == null)
return null;

treatAs = treatAs switch
{
CellType.Formula => throw new Exception("Cannot treat the cell contents as a Formula"),
CellType.Unknown => cell.CellType,
_ => treatAs
};
treatAs ??= cell.CellType;

switch (treatAs)
{
case CellType.Unknown:
default:
return cell.ToString();
case CellType.Numeric:

Expand Down Expand Up @@ -297,8 +292,6 @@ private object GetCellValue([CanBeNull] ICell cell, CellType treatAs = CellType.
return cell.BooleanCellValue;
case CellType.Error:
return null;
default:
throw new ArgumentOutOfRangeException(nameof(treatAs));
}
}

Expand Down
Loading