public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rptCCEReportFormat3 rpt = new rptCCEReportFormat3(); rpt.Site = this.Site; return(rpt); }
private void btnViewReport_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = Connection.GetDataSet("SELECT tbl_session.sessioncode, tbl_session.sessionname, tbl_student.studentno, tbl_student.scholarno,'Mr/Miss. '+ tbl_student.name as name , 'Mr. '+ tbl_student.father as father, " + " 'Mrs. '+ tbl_student.mother as mother, tbl_student.dob, tbl_student.C_address, tbl_student.m_tongue, tbl_student.casttype, tbl_student.bloodgroup,tbl_student.Height,tbl_student.Width,tbl_student.VisionL,tbl_student.VisionR,tbl_student.Teeth ,tbl_student.OHygiene,tbl_student.House,CASE WHEN tbl_student.CGPA IS NULL or tbl_student.CGPA='' THEN '..........' ELSE tbl_student.CGPA END as CGPA,CASE WHEN tbl_student.OGrade IS NULL or tbl_student.OGrade='' THEN '..........' ELSE tbl_student.OGrade END as OGrade, tbl_classstudent.stdtype,tbl_student.studentimage, " + " tbl_student.marr_status AS Gender, tbl_student.studentphoto, tbl_student.phone, tbl_student.bldgroup AS Medium, tbl_tehsil.tehsil, tbl_district.district, " + " tbl_district.statename, tbl_classmaster.classname, tbl_section.sectionname, tbl_classmaster.classname +' '+tbl_section.sectionname AS Class, " + " tbl_sankay.sankayname AS Stream, ISNULL(tbl_StudentAttendance.Lectures, 0) AS [Total Lecture], ISNULL(tbl_StudentAttendance.PresentDays, 0) AS [Total Present], ISNULL(tbl_StudentAttendance.Per , 0) AS [Per] " + " FROM tbl_section INNER JOIN " + " tbl_sankay INNER JOIN " + " tbl_classstudent ON tbl_sankay.sankaycode = tbl_classstudent.Stream INNER JOIN " + " tbl_classmaster ON tbl_classstudent.classno = tbl_classmaster.classcode INNER JOIN " + " tbl_student ON tbl_classstudent.studentno = tbl_student.studentno INNER JOIN " + " tbl_session ON tbl_classstudent.sessioncode = tbl_session.sessioncode ON tbl_section.sectioncode = tbl_classstudent.Section INNER JOIN " + " tbl_tehsil ON tbl_student.tehcode = tbl_tehsil.tehcode INNER JOIN " + " tbl_district ON tbl_student.distcode = tbl_district.distcode Left join tbl_StudentAttendance on tbl_student .studentno = tbl_StudentAttendance .StudentNo " + " WHERE (tbl_section.sectioncode = '" + cmbScetion.SelectedValue + "') AND (tbl_classstudent.ClassNo ='" + cmbClass.SelectedValue + "') " + " AND (tbl_session.sessioncode = '" + cmbSession.SelectedValue + "') and tbl_classstudent.stdtype<>'Ex-Student' Order By tbl_student.name ;" + " SELECT schoolname,schooladdress,schoolcity,schoolphone,affiliate_by,principal,registrationno,logoimage FROM tbl_school "); ds.WriteXmlSchema(@"" + Connection.GetAccessPathId() + @"Barcodes\a\rptCBSEMarksFrontDetail.xsd"); CrystalDecisions.CrystalReports.Engine.ReportDocument s = null; rptCCEReportFormat3 s3 = new rptCCEReportFormat3(); s3.PrintOptions.PaperOrientation = PaperOrientation.Landscape; s3.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA3; ShowAllReports cr = new ShowAllReports(); if (cmbClass.Text.Trim().Equals("IX") || cmbClass.Text.Trim().Equals("X")) { s = new rptCCEMarkFrontEnd(); s.PrintOptions.PaperOrientation = PaperOrientation.Landscape; s.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperLegal; s.SetDataSource(ds); cr.crystalReportViewer1.ReportSource = s; } else if (cmbClass.Text.Trim().Equals("I") || cmbClass.Text.Trim().Equals("II") || cmbClass.Text.Trim().Equals("III") || cmbClass.Text.Trim().Equals("IV") || cmbClass.Text.Trim().Equals("V") || cmbClass.Text.Trim().Equals("VI") || cmbClass.Text.Trim().Equals("VII") || cmbClass.Text.Trim().Equals("VIII")) { s = new rptCCEReportFormat2(); s.PrintOptions.PaperOrientation = PaperOrientation.Landscape; s.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA3; s.SetDataSource(ds); s.SetParameterValue("Class", Connection.GetNextClass(cmbClass.Text.Trim())); cr.crystalReportViewer1.ReportSource = s; } else { s3.SetDataSource(ds); s3.SetParameterValue("Class", Connection.GetNextClass(cmbClass.Text.Trim())); cr.crystalReportViewer1.ReportSource = s3; } cr.crystalReportViewer1.Zoom(54); cr.Show(); }