コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            TeacherReportStudentLogRPT rpt = new TeacherReportStudentLogRPT();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void LoadReport()
        {
            int ayid = Helper.getAYID(cmbAy);

            con = Connection.con();
            con.Open();

            query           = "proc_attendance_student";
            cmd             = new MySqlCommand(query, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("?vid", id);
            cmd.Parameters.AddWithValue("?vayid", ayid);
            cmd.Parameters.AddWithValue("?vfrom", dtFrom.Value.ToString("yyyy-MM-dd"));
            cmd.Parameters.AddWithValue("?vto", dtTo.Value.ToString("yyyy-MM-dd"));

            DataTable        dt    = new DataTable();
            MySqlDataAdapter adptr = new MySqlDataAdapter(cmd);

            adptr.Fill(dt);

            adptr.Dispose();
            cmd.Dispose();
            con.Close();


            TeacherReportStudentLogRPT rpt = new TeacherReportStudentLogRPT();

            rpt.SetDataSource(dt);
            crystalReportViewer1.ReportSource = rpt;
        }