Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (txtMalop.Text == string.Empty)
            {
                MessageBox.Show("Nhập đầy đủ thông tin!");
                return;
            }
            if (txtMamh.Text == string.Empty)
            {
                MessageBox.Show("Nhập đầy đủ thông tin!");
                return;
            }
            Baocao.rptInBangDiem obj = new Baocao.rptInBangDiem();
            string lenh = "EXEC SP_INBANGDIEM '" + txtMalop.Text + "','" + txtMamh.Text + "','" + cbxLanthi.Text + "'";

            try
            {
                DataTable tb = Program.ExecSqlDataTable(lenh);
                obj.SetDataSource(tb);
                obj.SetParameterValue("LOP", txtMalop.Text);
                obj.SetParameterValue("MONHOC", txtMamh.Text);
                obj.SetParameterValue("LANTHI", cbxLanthi.Text);
                crystalReportViewer1.ReportSource = obj;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi! " + ex.Message);
                return;
            }
        }
Ejemplo n.º 2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptInBangDiem rpt = new rptInBangDiem();

            rpt.Site = this.Site;
            return(rpt);
        }