public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpt_TSCC_BaoTri rpt = new rpt_TSCC_BaoTri();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
 private void Hist_OnMouseDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         string   ng          = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
         DateTime newdate     = new DateTime(dtpNgay.SelectedDate.Value.AddYears(-1).Year + 1, 1, 1);
         DateTime LastDayYear = new DateTime(dtpNgay.SelectedDate.Value.Year, 12, 31);
         cls.ClsConnect();
         string sqlload =
             "select a.*,b.PO_TEN from TSCC_HIS a left join DMPOS b on a.POS_CD=b.PO_MA where a.MA_TS='" + label.Content + "' and a.MNV='0' order by a.NG_DG_SC";
         //MessageBox.Show(sqlload);
         var dthis = cls.LoadDataText(sqlload);
         if (dthis.Rows.Count > 0)
         {
             /*
              * FileName = Thumuc + "\\" + label.Content + "_" + dtpNgay.SelectedDate.Value.ToString("ddMMyyyy") + ".csv";
              * s.ExportToExcel(dthis, FileName);
              * s.OpenExcel(FileName);
              */
             rpt_TSCC_BaoTri rpt = new rpt_TSCC_BaoTri();
             RPUtility.ShowRp(rpt, dthis, this, srv.DbSourceSerVer(), srv.DbNameSerVer(),
                              srv.DbUserSerVer(),
                              srv.DbPassSerVer());
         }
         else
         {
             MessageBox.Show("Không có dữ liệu !", "Thông báo", MessageBoxButton.OK,
                             MessageBoxImage.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Thông báo", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }