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

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

            _cls.ClsConnect();
            int thamso = 2;

            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);
            _dt       = _cls.LoadDataProcPara("usp_NVBQIN", bien, giatri, thamso);
            if (_dt.Rows.Count > 0)
            {
                rpt_NVBQ rpt = new rpt_NVBQ();
                RPUtility.ShowRp(rpt, _dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                FileName = Thumuc + "\\" + giatri[1] + "_SODU_NGUONVON_BQ_" + dtpNgay.SelectedDate.Value.ToString("ddMMyyyy") + ".csv";
                _str.ExportToExcel(_dt, FileName);
                MessageBox.Show("Copy Excel to : " + FileName, "Thông báo", MessageBoxButton.OK, MessageBoxImage.Information);
                _str.OpenExcel(FileName);
            }
            else
            {
                MessageBox.Show("Chưa có số liệu", "Thông báo");
            }
            _cls.DongKetNoi();
        }