public ActionResult ActiveStudents() { DB37Entities db = new DB37Entities(); //CrMVCApp.Models.Customer c; var c = db.ShowAllActiveStudents.ToList(); ActiveStudentsReport rpt = new ActiveStudentsReport(); rpt.Load(); rpt.SetDataSource(c); Stream s = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); return(File(s, "application/pdf")); }
public ActionResult ClassWiseActiveStudents() { string classname = ReportsController.classname; if (classname == "All") { return(RedirectToAction("ActiveStudents", "Reports")); } int classid = 1; DB37Entities db = new DB37Entities(); classid = db.Classtbls.Where(t => t.Section == classname).FirstOrDefault().Id; //CrMVCApp.Models.Customer c; var c = db.ShowClassWiseActiveStudents(classid).ToList(); ActiveStudentsReport rpt = new ActiveStudentsReport(); rpt.Load(); rpt.SetDataSource(c); Stream s = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); return(File(s, "application/pdf")); }