コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            BB_zhrbb_fl rpt = new BB_zhrbb_fl();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        //dataset ds=new dataset();
        //DataRow dr = ds.Tables[0].NewRow();
        //dr["Finishdate"] = finishdate;
        //dr["Operator"] =Operator;
        //dr["disp"] =disp;
        //ds.Tables[0].Rows.Add(dr);

        //生成报表数据
        private void GenerateZhrbbFl(string Time_start, string Time_end)
        {
            dt_start = Time_start.Replace('/', '-');
            dt_end   = Time_end.Replace('/', '-') + "  23:59:59";

            DateTime dt1 = DateTime.Parse(dt_start);
            DateTime dt2 = DateTime.Parse(dt_end);

            if (dt2 < dt1)
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "结束时间早于起始时间,请正确选择结束时间");
                return;
            }
            common_bb.displayprogress(progressBar1);
            ds = B_common.GetList(" select * from Bszhrbbfl", "id>=0  and   yydh='" + common_file.common_app.yydh + "' and  bbrq>='" + dt_start + "'  and bbrq<='" + dt_end + "'  order by bbrq  asc");
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                ds           = SummaryRow(ds);
                p_gl.Visible = false;

                string _qymc = ""; string _qymc_english = ""; string _address_chinese = ""; string _address_english = ""; string _qydh = ""; string _qycz = ""; string _qyyb = ""; string _website = "";
                common_file.common_app.GetPrintInfo(ref _qymc, ref _qymc_english, ref _address_chinese, ref _address_english, ref _qydh, ref _qycz, ref _qyyb, ref _website);


                BB_zhrbb_fl myreport = new BB_zhrbb_fl();
                common_bb.displayprogress(progressBar1);
                myreport.SetDataSource(ds.Tables[0]);
                myreport.SetParameterValue("qymc", common_file.common_app.qymc);
                myreport.SetParameterValue("address", _address_chinese);
                myreport.SetParameterValue("Tel", _qydh);
                myreport.SetParameterValue("Fax", _qycz);

                myreport.SetParameterValue("cssj", DateTime.Parse(Time_start.Trim().Replace('/', '-')).Date.ToShortDateString());
                myreport.SetParameterValue("jssj", DateTime.Parse(Time_end.Trim().Replace('/', '-')).Date.ToShortDateString());

                crystalReportViewer1.ReportSource = myreport;
            }
            else
            {
                crystalReportViewer1.ReportSource = null;
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "没有查到分析数据,请更改查询条件!");
            }
        }