Skip to content

7.3 Microsoft Excel

Jos de Weger edited this page Jan 1, 2019 · 1 revision

Getting the data for an Excel file requires the use of the MicrosoftExcelAdapter. The adapter only works with .xlsx files. This adapter has a couple of methods for getting the data from an .xlsx file:

  • Sheet GetFromBase64Encoded(string base64EncodedFile, string sheetName, ExcelRange range, bool stopReadingOnEmptyRow = false)
  • Sheet GetFromPath(string excelPath, string sheetName, ExcelRange range, bool stopReadingOnEmptyRow = false)
  • Sheet GetFromStream(Stream fileStream, string sheetName, ExcelRange range, bool stopReadingOnEmptyRow = false)

The property bool stopReadingOnEmptyRow = false makes it possible to stop reading the file contents when stumbling upon an empty row. It will returning the data collected so far. By providing a range with the maximum number of rows for Excel (1048576) it will all data until the first fully empty row will be detected, thus saving huge amounts of memory.

Clone this wiki locally