Created
October 25, 2018 20:38
-
-
Save vmandic/be8ccdef07c1653f1edcc76b8d64bcdd to your computer and use it in GitHub Desktop.
meds-processor, p3, s6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static ISheet OpenWorkbookSheetWithNpoi(FileStream stream, HzzoMedsDownloadDto med, HzzoMedsDownloadDto latestMed) | |
{ | |
ISheet drugListSheet = null; | |
try | |
{ | |
if (med.FileName.ToLowerInvariant().EndsWith(".xls")) | |
{ | |
var hssfWorkbook = new HSSFWorkbook(stream); | |
drugListSheet = hssfWorkbook.GetSheetAt(0); | |
} | |
else | |
{ | |
var xssfWorkbook = new XSSFWorkbook(stream); | |
drugListSheet = xssfWorkbook.GetSheetAt(0); | |
} | |
} | |
catch | |
{ | |
// TODO: log error, awh we will do that l8er | |
latestMed.Href += " - WORKSHEET COULD NOT BE PARSED"; | |
} | |
return drugListSheet; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment