public ActionResult ExportByNPOI() { List <客戶資料> exportData = 客戶repo.All().ToList(); MemoryStream output = new MemoryStream(); HSSFWorkbook book = new HSSFWorkbook(); output = 客戶repo.ExportExcel(exportData, book); return(File(output.ToArray(), "application/vnd.ms-excel", "客戶資料.xls")); }