Пример #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpt_QT14 rpt = new rpt_QT14();

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            // MessageBox.Show(BienBll.Ndma);
            ServerInfor srv = new ServerInfor();

            _cls.ClsConnect();
            int thamso = 3;

            string[] bien   = new string[thamso];
            object[] giatri = new object[thamso];
            bien[0] = "@Ngay";
            if (dtpNgay.SelectedDate != null)
            {
                giatri[0] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
            }
            bien[1]   = "@MaPos";
            giatri[1] = _str.Left(cboPos.SelectedValue.ToString().Trim(), 6);
            bien[2]   = "@Mau";
            if (Ration4.IsChecked != true)
            {
                if (Ration1.IsChecked == true)  //Mau 14
                {
                    giatri[2] = "1";
                    _dt       = _cls.LoadDataProcPara(giatri[1].ToString() == "003000" ? "usp_Khtc05_th" : "usp_Khtc05", bien,
                                                      giatri, thamso);
                }
                else if (Ration2.IsChecked == true) // Mau 14A
                {
                    giatri[2] = "2";
                    _dt       = _cls.LoadDataProcPara(giatri[1].ToString() == "003000" ? "usp_Khtc05_th" : "usp_Khtc05", bien,
                                                      giatri, thamso);
                }
            }
            else
            {
                giatri[2] = "1";
                _dt       = _cls.LoadDataProcPara("usp_Khtc05_cd", bien, giatri, thamso);
            }
            if (_dt.Rows.Count > 0)
            {
                if (Ration4.IsChecked == true)
                {
                    rpt_QT14_CD rpt = new rpt_QT14_CD();
                    RPUtility.ShowRp(rpt, _dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                }
                else
                {
                    if (Ration1.IsChecked == true)
                    {
                        rpt_QT14 rpt = new rpt_QT14();
                        RPUtility.ShowRp(rpt, _dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                    }
                    else
                    {
                        rpt_QT14A rpt = new rpt_QT14A();
                        RPUtility.ShowRp(rpt, _dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                    }
                }
            }
            else
            {
                MessageBox.Show("Chưa có số liệu", "Thông báo");
            }
            _cls.DongKetNoi();
        }