/// <summary> /// Default SaveAs Xlsx file /// </summary> public static void SaveAs(this Stream stream, object value, bool printHeader = true, string sheetName = null, ExcelType excelType = ExcelType.XLSX) { if (excelType == ExcelType.UNKNOWN) { throw new InvalidDataException("Please specify excelType"); } ExcelFacorty.GetExcelProvider(excelType, printHeader, sheetName).SaveAs(stream, value); }
public static IEnumerable <dynamic> Query(this Stream stream, bool useHeaderRow = false, ExcelType excelType = ExcelType.UNKNOWN, IConfiguration configuration = null) { if (excelType == ExcelType.UNKNOWN) { excelType = GetExcelType(stream); } return(ExcelFacorty.GetExcelProvider(excelType, useHeaderRow).Query(stream, useHeaderRow)); }
public static IEnumerable <T> Query <T>(this Stream stream, ExcelType excelType = ExcelType.UNKNOWN, IConfiguration configuration = null) where T : class, new() { if (excelType == ExcelType.UNKNOWN) { excelType = GetExcelType(stream); } return(ExcelFacorty.GetExcelProvider(excelType).Query <T>(stream)); }
public static void SaveAs(string filePath, object value, bool printHeader = true, ExcelType excelType = ExcelType.UNKNOWN) { if (excelType == ExcelType.UNKNOWN) { excelType = GetExcelType(filePath); } ExcelFacorty.GetExcelProvider(excelType, printHeader).SaveAs(filePath, value); }
public static void SaveAs(this Stream stream, object value, bool printHeader = true, ExcelType excelType = ExcelType.XLSX) { ExcelFacorty.GetExcelProvider(excelType, printHeader).SaveAs(stream, value); }
public static IEnumerable <dynamic> Query(this Stream stream, bool useHeaderRow = false, string sheetName = null, ExcelType excelType = ExcelType.UNKNOWN, IConfiguration configuration = null) { return(ExcelFacorty.GetExcelProvider(GetExcelType(stream, excelType), useHeaderRow, sheetName).Query(stream, useHeaderRow)); }
public static IEnumerable <T> Query <T>(this Stream stream, string sheetName = null, ExcelType excelType = ExcelType.UNKNOWN, IConfiguration configuration = null) where T : class, new() { return(ExcelFacorty.GetExcelProvider(GetExcelType(stream, excelType), sheetName).Query <T>(stream)); }