Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpt_TBNDH2 rpt = new rpt_TBNDH2();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
 private void BtnIn_OnClick(object sender, RoutedEventArgs e)
 {
     try
     {
         strsql = "select * from TBNDH where KU_MATO='" + s.Left(CboTo.SelectedValue.ToString().Trim(), 7)
                  + "' and NGAY='" + dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd") + "' and DENNGAY='"
                  + dtpDenNgay.SelectedDate.Value.ToString("yyyy-MM-dd") + "' and CHAPNHAN=1 or TUCHOI=1";
         cls.ClsConnect();
         var dtin = cls.LoadDataText(strsql);
         if (dtin.Rows.Count > 0)
         {
             strsql = "select * from TBNDH where KU_MATO='" + s.Left(CboTo.SelectedValue.ToString().Trim(), 7)
                      + "' and NGAY='" + dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd") + "' and DENNGAY='"
                      + dtpDenNgay.SelectedDate.Value.ToString("yyyy-MM-dd") + "' and CHAPNHAN=1";
             var       dtin1 = cls.LoadDataText(strsql);
             rpt_TBNDH rpt   = new rpt_TBNDH();
             RPUtility.ShowRp(rpt, dtin1, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                              srv.DbPassSerVer());
             rpt_TBNDH2 rpt1 = new rpt_TBNDH2();
             RPUtility.ShowRp(rpt1, dtin1, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                              srv.DbPassSerVer());
             strsql = "select * from TBNDH where KU_MATO='" + s.Left(CboTo.SelectedValue.ToString().Trim(), 7)
                      + "' and NGAY='" + dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd") + "' and DENNGAY='"
                      + dtpDenNgay.SelectedDate.Value.ToString("yyyy-MM-dd") + "' and TUCHOI=1";
             var        dtin2 = cls.LoadDataText(strsql);
             rpt_TBNDH1 rpt2  = new rpt_TBNDH1();
             RPUtility.ShowRp(rpt2, dtin2, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(),
                              srv.DbPassSerVer());
         }
         else
         {
             MessageBox.Show("Không có dữ liệu để in !", "Thông báo", MessageBoxButton.OK,
                             MessageBoxImage.Warning);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Tiếp tục" + ex.Message, "Mess");
     }
     cls.DongKetNoi();
 }