[解決]ASP.NET 的工作階段狀態已禁用。報表檢視器控制項要求在本地模式下啟用工作階段狀態。

來源:互聯網
上載者:User

問題現象:

添加Report WebPart後頁面不能顯示,查看日誌有如下訊息:
中文:ASP.NET 的工作階段狀態已禁用。報表檢視器控制項要求在本地模式下啟用工作階段狀態。
英文:Session state has been disabled for ASP.NET. The Report Viewer control requires that session state be enabled in local mode

解決辦法:

參看如下文章:http://ranaictiu-technicalblog.blogspot.com/2010/04/sharepoint-2010-configure-rdlc-report.html

Tuesday, April 20, 2010
SharePoint 2010: Configure RDLC report with ReportViewer
I have worked with SharePoint 2010 beta 2 and found the RDL(C) report is not configured automatically.  To run a sample report I did the following things. To make sure the configuration works for reporting just put a reportviewer control inside a webpart/page and try to access the page. First of all make sure you have intalled “Microsoft Report Viewer 2010 Redistributable Package”. You can download Microsoft Report Viewer 2010 Redistributable Package from http://www.microsoft.com/downloads/details.aspx?FamilyID=a941c6b2-64dd-4d03-9ca7-4017a0d164fd&displaylang=en.

Here are the steps to configure the SharePoint for report:

1. First find the following line in AppSettings and comment it out as shown below:

  <!--<add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />-->

2. By default session is disabled in SharePoint. Enable it by ensuring an entry like below inside <system.web>.

<sessionState mode="InProc" timeout="60" />  

3. Enable session at page level by setting the enableSessionState to true of <page…..> tag inside system.web.

<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" ……………………=""

4. SharePoint disable the default session module inside the <system.webserver>\modules tag. To enable the module comment out the following line inside <system.webserver>\moudles as shown below:

<!--<remove name="Session" />-->  

Now if you try to put a reportviewer control you will find a message like below:

If you find the above error then follow the steps 5, 6 and 7:

5. Add the following tag inside system.web\httphandlers section

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

6. Add the following line in the system.webserver\handlers

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

7. Comment out the following line in the system.WebServer\httphandlers (If Exists)

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

And finally it worked………..

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.