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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         cls.ClsConnect();
         DataTable dt     = new DataTable();
         int       thamso = 2;
         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)
         {
             MessageBox.Show("Chưa chọn ngày", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         else
         {
             giatri[1] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
         }
         //MessageBox.Show(giatri[0] + "  " + giatri[1] + "  " + giatri[2] + "  " + giatri[3] + "  " + giatri[4]);
         dt = cls.LoadLdbf("usp_THUNODH", bien, giatri, thamso);
         //rpt_kt740_01 rpt = new rpt_kt740_01();
         if (dt.Rows.Count > 0)
         {
             rpt_KH_THUNO rpt = new rpt_KH_THUNO();
             RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
             //dataGrid1.ItemsSource = dt.DefaultView;
             // FileName = Thumuc + "\\" + str.Left(CboPos.SelectedValue.ToString().Trim(), 6) + "_" + str.Left(CboDvut.SelectedValue.ToString().Trim(), 2) + "_" + str.Left(CboXa.SelectedValue.ToString().Trim(), 6) + "_" + dtpNgay.SelectedDate.Value.ToString("ddMMyyyy") + ".xlsx";
             // str.WriteDataTableToExcel(dt, "Person Details", FileName, "Details");
             //MessageBox.Show("Copy Excel to : " );
         }
         else
         {
             MessageBox.Show("Không có số liệu", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     cls.DongKetNoi();
 }