Friday, June 14, 2013

How to export html table into Excel file in ASP.MVC?

        public ActionResult ExportToExcel(int id)
        {
            string sb = "html table tag in here";
            byte[] buffer = System.Text.Encoding.UTF8.GetBytes(sb.ToString());
            return File(buffer, "application/vnd.ms-excel");
        }

No comments:

Post a Comment