Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            AttendRptClasswise rpt = new AttendRptClasswise();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void btn_ViewReport_Click(object sender, EventArgs e)
        {
            SqlDataAdapter da1 = new SqlDataAdapter("Select cstandard, division from tbl_class where classteacherno=" + SchoolManagement.empno, d.con);
            DataSet        ds1 = new DataSet();

            da1.Fill(ds1);
            DataRow dr1;

            dr1 = ds1.Tables[0].Rows[0];

            String         s  = "SELECT tbl_attendance.adno AS AdmissionNo, tbl_attendance.rollno AS RollNo, tbl_student.sname AS Name, CASE WHEN tbl_attendance.status= 1 Then 'Present' else 'Absend' END as Status FROM tbl_student INNER JOIN tbl_attendance ON tbl_student.adno = tbl_attendance.adno INNER JOIN tbl_class ON tbl_attendance.classno = tbl_class.classno where Convert(Varchar(10),tbl_attendance.date,101)='" + Convert.ToDateTime(dtp_classwise.Value.ToString()).ToString("MM/dd/yyyy") + "' And tbl_class.cstandard='" + dr1[0].ToString() + "'And tbl_class.division='" + dr1[1].ToString() + "'";
            SqlDataAdapter da = new SqlDataAdapter(s, d.con);
            DataSet        ds = new DataSet();

            da.Fill(ds);

            AttendRptClasswise ar = new AttendRptClasswise();

            ar.SetDataSource(ds.Tables[0]);


            SqlDataAdapter da2 = new SqlDataAdapter("Select SchoolName,SchoolAddress,Phone from tbl_School", d.con);
            DataSet        ds2 = new DataSet();

            da2.Fill(ds2);
            DataRow dr2;

            if (ds2.Tables[0].Rows.Count > 0)
            {
                dr2 = ds2.Tables[0].Rows[0];
                ar.SetParameterValue("Standard", dr1[0].ToString());
                ar.SetParameterValue("Division", dr1[1].ToString());
                ar.SetParameterValue("SchoolName", dr2[0].ToString());
                ar.SetParameterValue("Addr", dr2[1].ToString());
                ar.SetParameterValue("SchoolPhNo", dr2[2].ToString());
                ar.SetParameterValue("Date", dtp_classwise.Value.ToString());
                crystalReportViewer1.ReportSource = ar;
            }
        }