public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { Enquiryform rpt = new Enquiryform(); rpt.Site = this.Site; return(rpt); }
public override void btnprint_Click(object sender, EventArgs e) { string str = ""; str = "SELECT dbo.tbl_student_enquiry.name, dbo.tbl_student_enquiry.dob, dbo.tbl_student_enquiry.P_address, dbo.tbl_student_enquiry.father, dbo.tbl_student_enquiry.mother, dbo.tbl_student_enquiry.m_tongue, dbo.tbl_student_enquiry.casttype, dbo.tbl_student_enquiry.RegDate, dbo.tbl_student_enquiry.phone,dbo.tbl_student_enquiry.marr_status , dbo.tbl_classmaster.classname, dbo.tbl_student_enquiry.studentno FROM dbo.tbl_classmaster INNER JOIN dbo.tbl_student_enquiry ON dbo.tbl_classmaster.classcode = dbo.tbl_student_enquiry.admclass where tbl_student_enquiry.studentno='" + StuId + "'"; str = str + "SELECT schoolname, schooladdress, affiliate_by, logoimage, schoolphone FROM tbl_school "; str = str + "SELECT CONVERT(varchar(10), GETDATE(), 103) AS Expr1"; DataSet ds = Connection.GetDataSet(str); ds.WriteXmlSchema(@"" + Connection.GetAccessPathId() + @"Barcodes\a\Enquiry.xsd"); Enquiryform fr = new Enquiryform(); fr.PrintOptions.PaperOrientation = PaperOrientation.Portrait; fr.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperLetter; fr.SetDataSource(ds); ShowAllReports s = new ShowAllReports(); s.crystalReportViewer1.ReportSource = fr; s.Show(); }