public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { StudentReport rpt = new StudentReport(); rpt.Site = this.Site; return(rpt); }
private void crystalReportViewer1_Load(object sender, EventArgs e) { using (var Dbconnection = new MCDEntities()) { BindingSource bs = new BindingSource(); bs.DataSource = (from a in Dbconnection.Students select a).ToList <Student>(); StudentReport rpt = new StudentReport(); rpt.SetDataSource(bs); crystalReportViewer1.ReportSource = rpt; crystalReportViewer1.RefreshReport(); }; }