コード例 #1
0
        public ActionResult ClassAllTermMarks()
        {
            string classname = ReportsController.classname;

            if (classname == "All")
            {
                return(RedirectToAction("AdminReportsOnly", "Reports"));
            }
            int classid = 1;

            DB37Entities db = new DB37Entities();

            classid = db.Classtbls.Where(t => t.Section == ReportsController.classname).FirstOrDefault().Id;

            //CrMVCApp.Models.Customer c;
            var c = db.AllTermMarksOfAClass(classid).ToList();

            TermWiseMarks rpt = new TermWiseMarks();

            rpt.Load();
            rpt.SetDataSource(c);
            Stream s = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            return(File(s, "application/pdf"));
        }