Beispiel #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpt_QlyGqvlNew rpt = new rpt_QlyGqvlNew();

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            #region

            try
            {
                cls.ClsConnect();
                int      thamso = 5;
                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]   = "@MaXa";
                giatri[2] = str.Left(CboXa.SelectedValue.ToString().Trim(), 6);
                bien[3]   = "@Mau";
                if (Ration1.IsChecked == true)
                {
                    giatri[3] = "1";
                }
                else if (Ration2.IsChecked == true)
                {
                    giatri[3] = "2";
                }
                else
                {
                    giatri[3] = "3";
                }
                bien[4]   = "@Cqlv";
                giatri[4] = str.Left(CboCqlv.SelectedValue.ToString().Trim(), 2);

                dt = cls.LoadLdbf("usp_QlyGqvl", bien, giatri, thamso);
                if (dt.Rows.Count > 0)
                {
                    //rpt_QlyGqvl rpt = new rpt_QlyGqvl();
                    rpt_QlyGqvlNew rpt = new rpt_QlyGqvlNew();
                    RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                }

                else
                {
                    MessageBox.Show("Không có số liệu", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            cls.DongKetNoi();

            #endregion
        }