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

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #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] = bll.Left(CboPos.SelectedValue.ToString().Trim(), 6);
                bien[1]   = "@Ngay";
                if (dtpNgay.SelectedDate != null)
                {
                    giatri[1] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
                }
                if (giatri[1] == null)
                {
                    MessageBox.Show("Chưa chọn ngày : ", "Mess");
                    return;
                }
                bien[2]   = "@MaXa";
                giatri[2] = bll.Left(CboXa.SelectedValue.ToString().Trim(), 6);
                var dt = cls.LoadDataProcPara(ChkTh.IsChecked == true ? "usp_TLGDXA_TH" : "usp_TLGDXA", bien, giatri, thamso);

                if (dt.Rows.Count > 0)
                {
                    if (ChkTh.IsChecked == true)
                    {
                        rpt_TLGDXA_TH rpt = new rpt_TLGDXA_TH();
                        RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                                         srv.DbPassSerVer());
                    }
                    else
                    {
                        rpt_TLGDXA rpt = new rpt_TLGDXA();
                        RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                    }
                }
                else
                {
                    MessageBox.Show("Không có dữ liệu ", "Mess");
                }
                cls.DongKetNoi();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }