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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            Report.BaiThi obj = new Report.BaiThi();
            string        maMH = monHoc.Select(string.Format("[Tên môn học] ='{0}'", comboBox2.Text.Trim()))[0][0].ToString();
            string        maSV, hoten;

            if (DBAccess.nhom == "Sinh viên")
            {
                maSV  = DBAccess.id;
                hoten = DBAccess.hoTen;
            }
            else
            {
                maSV  = sinhVien.Select(string.Format("hoten ='{0}'", comboBox1.Text.Trim()))[0][0].ToString();
                hoten = comboBox1.Text.Trim();
            }

            int lan = Convert.ToInt32(comboBox3.Text);

            string[]  name     = { "@masv", "@mamh", "@lan" };
            object[]  param    = { maSV, maMH, lan };
            DataTable bangDiem = DBAccess.ExecuteQuery("SP_LayBaiThi", name, param, 3);

            obj.SetDataSource(bangDiem);
            obj.SetParameterValue("@masv", maSV);
            obj.SetParameterValue("ma sv", maSV);
            obj.SetParameterValue("ten", hoten);
            obj.SetParameterValue("tenmh", comboBox2.Text.Trim());
            obj.SetParameterValue("@mamh", maMH);
            obj.SetParameterValue("@lan", lan);
            crptView.ReportSource = obj;
        }