コード例 #1
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            BaoCao.rptBangDiemTheoLop obj;
            obj = new BaoCao.rptBangDiemTheoLop();

            string strLenh;

            strLenh = "EXEC SP_RP_BANGDIEMLOP '" + cmbTenLop.SelectedValue.ToString() + "', '" +
                      cmbTenMH.SelectedValue.ToString() + "','" + cmbLan.Text + "'";
            DataTable MyTable;

            MyTable = Program.ExecSqlDataTable(strLenh);

            obj.SetDataSource(MyTable);
            obj.SetParameterValue("TENLOP", cmbTenLop.Text);
            obj.SetParameterValue("TENMH", cmbTenMH.Text);
            obj.SetParameterValue("LAN", cmbLan.Text);
            crptView.ReportSource = obj;
        }