<add name="Session" type="System.Web.SessionState.SessionStateModule"/>

 

HTTP 协议之所以能够获得如此大的成功,其设计实现的简洁性和无状态连接的高效率是很重要的原因。而为了在无状态的 HTTP 请求和有状态的客户端操作之间达到平衡,产生了服务器端会话 (Session) 的概念。客户端在连接到服务器后,就由 Web 服务器产生并维护一个客户端的会话;当客户端通过无状态 HTTP 协议再次连接到服务器时,服务器根据客户端提交的某种凭据,如 Cookie URL 参数,将客户关联到某个会话上。这种思路在各种开发语言和开发环境中大量得到应用。
ASP.NET 中,Web 应用程序和会话状态被分别进行维护,通过 HttpApplication HttpSessionState 分离 Web 应用程序与会话的功能。应用程序层逻辑在 Global.asax 文件中实现,运行时编译成 System.Web.HttpApplication 的实例;会话则作为单独的 System.Web.SessionState.HttpSessionState 实例,由服务器统一为每个用户会话维护,通过 ASP.NET 页面编译成的 System.Web.UI.Page 对象子类的 Session 属性访问。关于 ASP.NET 中不同层次关系可参考我以前的一篇文章《.NET 1.1中预编译ASP.NET页面实现原理浅析 [1] 自动预编译机制浅析》,以下简称【文1】。

 

 

this.ReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
            try
            {
                if (ReportServerURL.Trim() == string.Empty)
                {
                    this.ReportViewer.ServerReport.ReportServerUrl = new Uri("http://localhost:81/reportserver");
                }
                else
                {
                    ReportViewer.ServerReport.ReportServerUrl = new Uri(ReportServerURL);
                }
                if (ReportServerURL.Trim() == string.Empty)
                {
                    ReportViewer.ServerReport.ReportPath = "/SkyFlying/SignedAchievement_Month_SellMan";
                }
                else
                {
                    ReportViewer.ServerReport.ReportPath = ReportPath;
                }
               


                List<ReportParameter> paramList = new List<ReportParameter>();
                paramList.Add(new ReportParameter("StartYearMonth", "2007-01"));
                paramList.Add(new ReportParameter("EndYearMonth", "2007-02"));
                paramList.Add(new ReportParameter("SellPKID", new string[] { "18", "19" }));
                //paramList.Add(new ReportParameter("TeamId", new string[] { "2", "3" }));
                //paramList.Add(new ReportParameter("DivisionId", new string[] { "01" }));
                ReportViewer.ServerReport.SetParameters(paramList);

 

            }
            catch (Exception ex)
            {
                throw ex;
            }

 

 

如果无参:

 

try
            {
                ReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
                if (ReportServerURL.Trim() == string.Empty)
                {
                    this.ReportViewer.ServerReport.ReportServerUrl = new Uri("http://localhost:81/reportserver");
                }
                else
                {
                    ReportViewer.ServerReport.ReportServerUrl = new Uri(ReportServerURL);
                }
                if (ReportServerURL.Trim() == string.Empty)
                {
                    ReportViewer.ServerReport.ReportPath = "/SkyFlying/emptyreport";
                }
                else
                {
                    ReportViewer.ServerReport.ReportPath = ReportPath;
                }

               
                ReportViewer.DataBind();

            }
            catch (Exception ex)
            {
                throw ex;
            }

 

 

 

WSS 的web.config 应注意的节点:

<add name="Session" type="System.Web.SessionState.SessionStateModule"/>

 

<httpHandlers>

<add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

posted on 2008-09-05 11:59  blogsweb  阅读(380)  评论(0)    收藏  举报