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

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                cls.ClsConnect();
                int      thamso = 3;
                string[] bien   = new string[thamso];
                object[] giatri = new object[thamso];
                bien[0]   = "@MaPos";
                giatri[0] = str.Left(CboPos.SelectedValue.ToString().Trim(), 6);
                bien[1]   = "@Ngay";
                if (dtpNgay.SelectedDate != null)
                {
                    giatri[1] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
                }
                bien[2] = "@Mau";
                if (Ration1.IsChecked != null && (bool)Ration1.IsChecked)
                {
                    giatri[2] = "1";
                }
                else if (Ration2.IsChecked != null && (bool)Ration2.IsChecked)
                {
                    giatri[2] = "2";
                }
                else
                {
                    giatri[2] = "3";
                }

                // MessageBox.Show(giatri[0]+","+giatri[1] + ","+giatri[2] + ","+giatri[3] + ","+giatri[4]);
                dt = cls.LoadDataProcPara("usp_TGTKTO", bien, giatri, thamso);
                if (dt.Rows.Count > 0)
                {
                    rpt_TGTKTO01 rpt = new rpt_TGTKTO01();
                    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");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            cls.DongKetNoi();
        }