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

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
 private void   inital()
 {
     if (lsbh.Trim() != "" && sk_tt.Trim() != "")
     {
         ysk_tj = GetYsk(lsbh);
         if (sk_tt == "sk")
         {
             ds = B_common.GetList(" SELECT * from  View_skyd_djb  ", "  lsbh='" + lsbh + "'  and yydh='" + common_file.common_app.yydh + "'");
             if (ds != null && ds.Tables[0].Rows.Count > 0)
             {
                 try
                 {
                     Q_skyd_djb myreport = new Q_skyd_djb();
                     for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                     {
                         if (ds.Tables[0].Rows[i]["zjhm"].ToString().Trim() != "")
                         {
                             ds.Tables[0].Rows[i]["yxzj"] = (ds.Tables[0].Rows[i]["yxzj"].ToString() + ": ") as object;
                         }
                         else
                         {
                             ds.Tables[0].Rows[i]["yxzj"] = ("") as object;
                         }
                     }
                     myreport.SetDataSource(ds.Tables[0]);
                     crystalReportViewer1.ReportSource = myreport;
                     myreport.SetParameterValue("czy", czy);
                     myreport.SetParameterValue("ysk_tj", ysk_tj);
                     myreport.PrintToPrinter(1, true, 0, 0);
                 }
                 catch
                 {
                     common_file.common_app.Message_box_show(common_file.common_app.message_title, "打印出错,请正确设置打印机");
                 }
             }
             else
             {
                 common_file.common_app.Message_box_show(common_file.common_app.message_title, "当前订单没有任何在住客人信息,打印终止!");
             }
         }
         if (sk_tt == "tt")
         {
             ds = B_common.GetList(" SELECT  *   from  VIEW_Qttyd_djb  ", "  ddbh='" + ddbh + "'  and yydh='" + common_file.common_app.yydh + "'");
             if (ds != null && ds.Tables[0].Rows.Count > 0)
             {
                 try
                 {
                     Q_skyd_djb myreport = new Q_skyd_djb();
                     for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                     {
                         if (ds.Tables[0].Rows[i]["zjhm"].ToString().Trim() != "")
                         {
                             ds.Tables[0].Rows[i]["yxzj"] = (ds.Tables[0].Rows[i]["yxzj"].ToString() + ": ") as object;
                         }
                         else
                         {
                             ds.Tables[0].Rows[i]["yxzj"] = ("") as object;
                         }
                         if (DateTime.Parse(ds.Tables[0].Rows[i]["krsr"].ToString().Trim()).Date.CompareTo(DateTime.Parse(common_file.common_app.cssj)) == 0)
                         {
                             ds.Tables[0].Rows[i]["krsr"] = "";
                         }
                     }
                     myreport.SetDataSource(ds.Tables[0]);
                     crystalReportViewer1.ReportSource = myreport;
                     myreport.SetParameterValue("czy", czy);
                     myreport.SetParameterValue("ysk_tj", ysk_tj);
                     myreport.PrintToPrinter(1, true, 0, 0);
                 }
                 catch
                 {
                     common_file.common_app.Message_box_show(common_file.common_app.message_title, "打印出错,请正确设置打印机");
                 }
             }
             else
             {
                 common_file.common_app.Message_box_show(common_file.common_app.message_title, "当前订单没有任何在住客人信息,打印终止!");
             }
         }
     }
 }