public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { AllEnrollments rpt = new AllEnrollments(); rpt.Site = this.Site; return(rpt); }
private void metroButton1_Click(object sender, EventArgs e) { using (var Dbconnection = new MCDEntities()) { Impendulo.Common.Reports.AllEnrollments rpt = new Impendulo.Common.Reports.AllEnrollments(); List <GetAllEnrollmentsCompanyAndStudent_Result> ds = Dbconnection.GetAllEnrollmentsCompanyAndStudent().ToList <GetAllEnrollmentsCompanyAndStudent_Result>(); List <Impendulo.Common.ReportModels.Enrollments> x = new List <Enrollments>(); //ds.ForEach(GetAllEnrollmentsCompanyAndStudent_Result GAECASR in ) foreach (GetAllEnrollmentsCompanyAndStudent_Result GAECASR in ds) { x.Add(new Impendulo.Common.ReportModels.Enrollments() { DepartmentName = GAECASR.DepartmentName, AmountEnrolled = (int)GAECASR.AmountEnrolled, Client = GAECASR.Client, CourseLocation = GAECASR.CourseLocation, CourseName = GAECASR.CourseName, CurriculumName = GAECASR.CurriculumName, ScheduleCompletionDate = GAECASR.ScheduleCompletionDate, ScheduleStartDate = GAECASR.ScheduleStartDate }); } rpt.SetDataSource(x); crystalReportViewer1.ReportSource = rpt; crystalReportViewer1.RefreshReport(); }; }
private void metroButton2_Click(object sender, EventArgs e) { using (var Dbconnection = new MCDEntities()) { Impendulo.Common.Reports.AllEnrollments rpt = new Impendulo.Common.Reports.AllEnrollments(); List <GetAllEnrollmentsPerCompany_Result> ds = Dbconnection.GetAllEnrollmentsPerCompany(Common.Verifiction.OfProgressFiles.VerifyCompanyProgressFile(2004)).ToList <GetAllEnrollmentsPerCompany_Result>(); List <Impendulo.Common.ReportModels.Enrollments> x = new List <Enrollments>(); //ds.ForEach(GetAllEnrollmentsCompanyAndStudent_Result GAECASR in ) foreach (GetAllEnrollmentsPerCompany_Result GAECASR in ds) { int xx = 0; if (GAECASR.ScheduleStartDate.Equals("Not Yet Secheduled")) { xx = 0; } else { xx = 1; } x.Add(new Impendulo.Common.ReportModels.Enrollments() { DepartmentName = GAECASR.DepartmentName, AmountEnrolled = (int)GAECASR.AmountEnrolled, // Client = GAECASR.Client, DeterminIfScheduledOrNot = xx, CourseLocation = GAECASR.CourseLocation, CourseName = GAECASR.CourseName, CurriculumName = GAECASR.CurriculumName, ScheduleCompletionDate = GAECASR.ScheduleCompletionDate, ScheduleStartDate = GAECASR.ScheduleStartDate }); } rpt.SetDataSource(x); crystalReportViewer1.ReportSource = rpt; crystalReportViewer1.RefreshReport(); }; }