Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            //查询SQL从URL的参数中获得
            ArrayList QueryList = new ArrayList();

            string QuerySQL = context.Request.QueryString["QuerySQL"];

            QueryList.Add(new ReportQueryItem(QuerySQL, "QuerySQL"));

            QuerySQL = context.Request.QueryString["QuerySQL2"];
            if (QuerySQL != null && QuerySQL != "")
            {
                QueryList.Add(new ReportQueryItem(QuerySQL, "QuerySQL2"));

                QuerySQL = context.Request.QueryString["QuerySQL3"];
                if (QuerySQL != null && QuerySQL != "")
                {
                    QueryList.Add(new ReportQueryItem(QuerySQL, "QuerySQL3"));
                }
            }

            string DataText = DataTextProvider.Build(QueryList);

            GridReportDataResponse.Response(context.Response, DataText, GridReportDataResponse.DefaultDataType);
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            //根据HTPP请求中的产生,生成对应的报表文本形式(XML 或 JSON)的数据
            string DataText = DataTextProvider.BuildByHttpRequest(context.Request);

            //将获取到的报表文本数据(XML 或 JSON)响应给客户端
            GridReportDataResponse.Response(context.Response, DataText, GridReportDataResponse.DefaultDataType);
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            //从客户端发送的数据包中获取报表查询参数,URL有长度限制,当要传递的参数数据量比较大时,应该采用这样的方式
            //这里演示了用这样的方式传递一个超长查询SQL语句。
            byte[]       FormData  = context.Request.BinaryRead(context.Request.TotalBytes);
            UTF8Encoding Unicode   = new UTF8Encoding();
            int          charCount = Unicode.GetCharCount(FormData, 0, context.Request.TotalBytes);

            char[] chars             = new Char[charCount];
            int    charsDecodedCount = Unicode.GetChars(FormData, 0, context.Request.TotalBytes, chars, 0);
            String QuerySQL          = new String(chars);

            string DataText = DataTextProvider.Build(QuerySQL);

            GridReportDataResponse.Response(context.Response, DataText, GridReportDataResponse.DefaultDataType);
        }