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

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         cls.ClsConnect();
         int      thamso = 5;
         string[] bien   = new string[thamso];
         object[] giatri = new object[thamso];
         bien[0]   = "@MaPos";
         giatri[0] = bll.Left(CboPos.SelectedValue.ToString().Trim(), 6);
         bien[1]   = "@MaXa";
         giatri[1] = bll.Left(CboXa.SelectedValue.ToString().Trim(), 6);
         bien[2]   = "@Mato";
         giatri[2] = bll.Left(CboTo.SelectedValue.ToString().Trim(), 7);
         bien[3]   = "@Ngay";
         if (dtpNgay.SelectedDate == null)
         {
             MessageBox.Show("Chưa chọn ngày ", "Mess");
             return;
         }
         else
         {
             giatri[3] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
         }
         bien[4] = "@Mau";
         if (Ration1.IsChecked == true)
         {
             giatri[4] = "1";
         }
         else
         {
             giatri[4] = "2";
         }
         dt = cls.LoadDataProcPara("usp_DCPTNO", bien, giatri, thamso);
         if (dt.Rows.Count > 0)
         {
             if (Ration1.IsChecked == true)
             {
                 rpt_DCPTNO_DC rpt = new rpt_DCPTNO_DC();
                 RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
             }
             else if (Ration2.IsChecked == true)
             {
                 rpt_DCPTNO_PT rpt = new rpt_DCPTNO_PT();
                 RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
             }
             else
             {
                 rpt_DCPTNO rpt = new rpt_DCPTNO();
                 RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
             }
         }
         else
         {
             MessageBox.Show("Không có bản ghi nào ", "Mess");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }