public static IEnumerable <string> GetSheetNames(this Stream stream) { var archive = new ExcelOpenXmlZip(stream); foreach (var item in ExcelOpenXmlSheetReader.GetWorkbookRels(archive.Entries)) { yield return(item.Name); } }
/// <summary> /// QueryAsDataTable is not recommended, because it'll load all data into memory. /// </summary> public static Task <DataTable> QueryAsDataTableAsync(this Stream stream, bool useHeaderRow = true, string sheetName = null, ExcelType excelType = ExcelType.UNKNOWN, string startCell = "A1", IConfiguration configuration = null) { return(Task.Run(() => ExcelOpenXmlSheetReader.QueryAsDataTableImpl(stream, useHeaderRow, ref sheetName, excelType, startCell, configuration))); }
public IEnumerable <T> Query <T>(string sheetName, string startCell) where T : class, new() { return(ExcelOpenXmlSheetReader.QueryImpl <T>(Query(false, sheetName, startCell), startCell, this._config)); }
public static List <string> GetSheetNames(this Stream stream) { var archive = new ExcelOpenXmlZip(stream); return(ExcelOpenXmlSheetReader.GetWorkbookRels(archive.Entries).Select(s => s.Name).ToList()); }