首页 > 其他 > 详细

报表页面的异步加载

时间:2015-04-25 18:03:24      阅读:98      评论:0      收藏:0      [点我收藏+]

 $("#btn_search").click(function () {
            var computeTime = $("#txt_computeTime_").val();
            var endComputeTime = $("#txt_EndcomputeTime_").val();
            var simulationNumber = $("#txt_simulationNumber_").val();
            var riskBookId = $("#txt_select_").val();
            var checked = $("#chk_3d").checked;
            var viewType = "2d";
            if (checked) {
                viewType = "3d";
            }
            var url = "/ReportEg/Report2.aspx?_method=GetReport&txt_computeTime_=" + computeTime + "&txt_simulationNumber_=" + simulationNumber + "&txt_select_=" + riskBookId + "&viewtype=" + viewType + "&txt_EndcomputeTime_=" + endComputeTime + "";
            $.ajax({
                async: true,
                type: "GET",
                url: url,
                data: {},
                dataType: "text",
                success: function (data) {
                    $("#VisifireChart1").html("");
                    if (data.length > 0) {
                        var vChart = new Visifire2(‘../SL.Visifire.Charts.xap‘, 800, 500);
                        vChart.setDataXml(data);
                        vChart.render(‘VisifireChart1‘);
                    }


                }
            });



        });

后台:

             if (Request["_method"] == "GetReport")
                {
                   string riskBookId = Request["txt_select_"].ToString();
                    string computeDate = Request["txt_computeTime_"].ToString();
                    string endcomputeDate = Request["txt_EndcomputeTime_"].ToString();
                    string simulationNumber = Request["txt_simulationNumber_"].ToString();
                    string viewType = Request["viewtype"].ToString();
                    txt_computeTime_.Value = computeDate;
                    txt_simulationNumber_.Value = simulationNumber;
                    if (string.IsNullOrEmpty(riskBookId) || string.IsNullOrEmpty(computeDate) || string.IsNullOrEmpty(simulationNumber))
                    {
                        throw new Exception("查询参数均不可为空!");

                    }
                    Framework.QueryInfo info = new Framework.QueryInfo();
                    info.QueryObject = "RskBookHistogram";
                    info.CustomSQL = "select Tick_Value,Frequency_Value from rsk_book_histogram where Compute_Date>=:Compute_Date and Compute_Date<=:endcomputeDate and Simulation_Number=" + simulationNumber;
                    info.Parameters.Add("Compute_Date",DateTime.Parse(computeDate));
                    info.Parameters.Add("endcomputeDate",DateTime.Parse(endcomputeDate));
                    DataSet dt = Dao.ExcuteDataSet(info);
                    vChartDataSet = dt;
                    string outputtext = "<script language=‘javascript‘ type=‘text/javascript‘>";
                    var dataXml = "";
                    if(viewType == "3d")
                        dataXml += "<vc:Chart xmlns:vc=‘clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts‘ Width=‘800‘ Height=‘500‘ Theme=‘Theme1‘ BorderThickness=‘0‘ View3D=‘True‘ Watermark=‘False‘ ScrollingEnabled=‘False‘>";
                    else if(viewType == "2d")
                        dataXml += "<vc:Chart xmlns:vc=‘clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts‘ Width=‘800‘ Height=‘500‘ Theme=‘Theme1‘ BorderThickness=‘0‘ View3D=‘False‘ Watermark=‘False‘ ScrollingEnabled=‘False‘>";
                    dataXml += "<vc:Chart.Titles><vc:Title Text=‘分析图2‘/></vc:Chart.Titles>";
                    dataXml += "<vc:Chart.AxesX><vc:Axis Title=‘直方图横坐标‘></vc:Axis></vc:Chart.AxesX>";
                    dataXml += "<vc:Chart.AxesY><vc:Axis Title=‘频数值‘ /></vc:Chart.AxesY>";
                    dataXml += "<vc:Chart.Series>";
                    dataXml += "<vc:DataSeries LegendText=‘‘ RenderAs=‘Column‘ LabelEnabled=‘true‘ LabelStyle=‘OutSide‘ Cursor=‘Hand‘>";
                    dataXml += "<vc:DataSeries.DataPoints>";
                    foreach (DataRow row in dt.Tables[0].Rows)
                    {
                        dataXml += "<vc:DataPoint AxisXLabel=‘" + row["Tick_Value"].ToString() + "‘ YValue=‘" + row["Frequency_Value"].ToString() + "‘/>";
                    }
                    dataXml += "</vc:DataSeries.DataPoints>";
                    dataXml += "</vc:DataSeries>";
            
                    dataXml += "</vc:Chart.Series>";
                    dataXml += "</vc:Chart>";
                  Response.Write(dataXml);
                  Response.End();
                  
                }

报表页面的异步加载

原文:http://www.cnblogs.com/kexb/p/4456252.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!