Beispiel #1
0
        public static string ExportToExcel(DataTable dt, string file, string extension = ".xlsx")
        {
            string newPath = CheckExport(dt, file, extension);

            ExcelByNpoi.ExportDataTableToExcel(newPath, dt);
            return(newPath);
        }
Beispiel #2
0
        public static string ExportToExcel(IEnumerable <DataTable> dts, string file, string extension = ".xlsx")
        {
            string newPath = Path.ChangeExtension(file, extension);

            DirectoryHelper.CreateDirectory(newPath);
            ExcelByNpoi.ExportDataTableToExcel(newPath, dts.ToArray());
            return(newPath);
        }