예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptBangDiem2 rpt = new rptBangDiem2();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void btnINDIEM_Click(object sender, EventArgs e)
        {
            /*malop = cmbTENLOP.SelectedValue.ToString().Trim();
             * mamh = cmbTENMH.SelectedValue.ToString().Trim();
             * lan = Int16.Parse(txtLan.ToString().Trim());
             * String sql = "EXEC SP_BANGDIEM '"+malop+"','"+mamh+"',"+lan;
             * Program.myReader = Program.ExecSqlDataReader(sql);
             * if (Program.myReader == null) return;
             * while(Program.myReader.Read())
             * {
             *  BANGDIEM temp = new BANGDIEM(Program.myReader.GetString(0).Trim(),
             *      Program.myReader.GetString(1).Trim(),
             *      Program.myReader.GetString(2).Trim(),
             *      Program.myReader.GetDouble(4));
             *  bd.Add(temp);
             * }*/
            rptBangDiem2 obj;

            obj   = new rptBangDiem2();
            malop = cmbTENLOP.SelectedValue.ToString().Trim();
            mamh  = cmbTENMH.SelectedValue.ToString().Trim();
            lan   = Int16.Parse(txtLan.ToString().Trim());
            String    sql = "EXEC SP_BANGDIEM '" + malop + "','" + mamh + "'," + lan;
            DataTable myDataTable;

            myDataTable = Program.ExecSqlDataTable(sql, Program.connstr);
            obj.SetDataSource(myDataTable);
            obj.SetParameterValue("LOP", cmbTENLOP.SelectedText.ToString().Trim());
            obj.SetParameterValue("MONHOC", cmbTENMH.SelectedText.ToString().Trim());
            obj.SetParameterValue("LAN", lan);
            crptView.ReportSource = obj;
        }