コード例 #1
0
ファイル: MiniExcel.cs プロジェクト: sdikerdong/MiniExcel
        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);
            }
        }
コード例 #2
0
 /// <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)));
 }
コード例 #3
0
 public IEnumerable <T> Query <T>(string sheetName, string startCell) where T : class, new()
 {
     return(ExcelOpenXmlSheetReader.QueryImpl <T>(Query(false, sheetName, startCell), startCell, this._config));
 }
コード例 #4
0
        public static List <string> GetSheetNames(this Stream stream)
        {
            var archive = new ExcelOpenXmlZip(stream);

            return(ExcelOpenXmlSheetReader.GetWorkbookRels(archive.Entries).Select(s => s.Name).ToList());
        }