コード例 #1
0
        public FileResult Export([DataSourceRequest]DataSourceRequest request)
        {
            DemoEntities db = new DemoEntities();
            byte[] bytes = WriteExcel(db.Table.ToDataSourceResult(request).Data, new string[] { "Id", "Name" });

            return File(bytes,
                "application/vnd.ms-excel",
                "GridExcelExport.xls");
        }
コード例 #2
0
 public ActionResult Read([DataSourceRequest]DataSourceRequest request)
 {
     DemoEntities db = new DemoEntities();
     return Json(db.Table.ToDataSourceResult(request));
 }