示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            BB_zdkr_mxfx rpt = new BB_zdkr_mxfx();

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
        public string LoadType = "";  //按哪种类型来查看
        public void displayBB(string Time_end)
        {
            common_file.common_app.get_czsj();
            DateTime dt2 = DateTime.Parse(Time_end.Trim().Replace('/', '-') + "  23:59:59");

            sel_con_temp  = "";
            sel_con_temp += "   and  lksj<='" + dt2.ToString() + "'   ";

            if (tb_krly.Text.Trim() != "")
            {
                sel_con_temp += "   and  krly like '%" + tb_krly.Text.Trim() + "%' ";
            }

            if (tb_lc.Text.Trim() != "")
            {
                sel_con_temp += "  and   jdcs_name  like  '%" + tb_lc.Text.Trim() + "%'  ";
            }
            if (tb_lh.Text.Trim() != "")
            {
                sel_con_temp += "  and   jdlh_name like  '%" + tb_lh.Text.Trim() + "%'  ";
            }
            ds = Get_zdmxData(dt2.ToString(), sel_con_temp, LoadType);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                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);



                int manTotal   = 0;
                int womanTotal = 0;
                int qt         = 0;
                int total      = 0;
                if (LoadType == "krxb")
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        if (ds.Tables[0].Rows[i]["krxb"].ToString() == "男")
                        {
                            manTotal += 1;
                        }
                        else if (ds.Tables[0].Rows[i]["krxb"].ToString() == "女")
                        {
                            womanTotal += 1;
                        }
                        else
                        {
                            qt += 1;
                        }
                    }
                    total = manTotal + womanTotal + qt;
                }



                if (LoadType == "krly_nofj")
                {
                    BB_zdkr_mxfx myreport = new BB_zdkr_mxfx();
                    common_bb.displayprogress(progressBar1);
                    myreport.SetDataSource(ds.Tables[0]);
                    //myreport.SetParameterValue("cssj", Time_begin.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("jssj", Time_end.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("qymc", _qymc);
                    myreport.SetParameterValue("address", _address_chinese);
                    myreport.SetParameterValue("Tel", _qydh);
                    myreport.SetParameterValue("Fax", _qycz);
                    crystalReportViewer1.ReportSource = myreport;
                }
                if (LoadType == "krly_fj")
                {
                    BB_zdkr_mxfx_krly_fj myreport = new BB_zdkr_mxfx_krly_fj();
                    common_bb.displayprogress(progressBar1);
                    myreport.SetDataSource(ds.Tables[0]);
                    //myreport.SetParameterValue("cssj", Time_begin.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("jssj", Time_end.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("qymc", _qymc);
                    myreport.SetParameterValue("address", _address_chinese);
                    myreport.SetParameterValue("Tel", _qydh);
                    myreport.SetParameterValue("Fax", _qycz);
                    crystalReportViewer1.ReportSource = myreport;
                }
                if (LoadType == "fjbh")
                {
                    BB_zdkr_mxfx_fjbh myreport = new BB_zdkr_mxfx_fjbh();
                    common_bb.displayprogress(progressBar1);
                    myreport.SetDataSource(ds.Tables[0]);
                    //myreport.SetParameterValue("cssj", Time_begin.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("jssj", Time_end.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("qymc", _qymc);
                    myreport.SetParameterValue("address", _address_chinese);
                    myreport.SetParameterValue("Tel", _qydh);
                    myreport.SetParameterValue("Fax", _qycz);
                    crystalReportViewer1.ReportSource = myreport;
                }
                if (LoadType == "fjbhWithNoFj")
                {
                    BB_zdkr_mxfx_fjbh_nofj myreport = new BB_zdkr_mxfx_fjbh_nofj();
                    common_bb.displayprogress(progressBar1);
                    myreport.SetDataSource(ds.Tables[0]);
                    //myreport.SetParameterValue("cssj", Time_begin.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("jssj", Time_end.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("qymc", _qymc);
                    myreport.SetParameterValue("address", _address_chinese);
                    myreport.SetParameterValue("Tel", _qydh);
                    myreport.SetParameterValue("Fax", _qycz);
                    crystalReportViewer1.ReportSource = myreport;
                }

                if (LoadType == "krxb")
                {
                    BB_zdkr_mxfx_krxb myreport = new BB_zdkr_mxfx_krxb();
                    common_bb.displayprogress(progressBar1);
                    myreport.SetDataSource(ds.Tables[0]);
                    //myreport.SetParameterValue("cssj", Time_begin.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("jssj", Time_end.Trim().Replace('/', '-'));
                    myreport.SetParameterValue("qymc", _qymc);
                    myreport.SetParameterValue("address", _address_chinese);
                    myreport.SetParameterValue("Tel", _qydh);
                    myreport.SetParameterValue("Fax", _qycz);
                    myreport.SetParameterValue("manTotal", manTotal.ToString());
                    myreport.SetParameterValue("womanTotal", womanTotal.ToString());
                    myreport.SetParameterValue("qt", qt.ToString());
                    myreport.SetParameterValue("Total", total.ToString());
                    crystalReportViewer1.ReportSource = myreport;
                }
            }
            else
            {
                crystalReportViewer1.ReportSource = null;
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "没有分析数据,请更改查询条件!");
                return;
            }
            Cursor.Current = Cursors.Default;
        }