public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrystalReport1 rpt = new CrystalReport1(); rpt.Site = this.Site; return(rpt); }
private void Print_Form_Load(object sender, EventArgs e) { string query = "SELECT sub_list.Subject_Name,sub_list.Subject_Grade FROM sub_list,Student_updateloginId WHERE sub_list.Student_ID = Student_updateloginId.Student_ID"; SqlCommand cmd = new SqlCommand(query, sqlcon); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); CrystalReport1 cr = new CrystalReport1(); cr.Database.Tables["Report"].SetDataSource(dt); crystalReportViewer1.ReportSource = null; crystalReportViewer1.ReportSource = cr; }