Pages

Monday 10 February 2014

SharePoint 2013:Configure RDLC report with Report Viewer



Here are the steps to configure the SharePoint for report:
        First find the following line in AppSettings in your web.config file and comment it out as shown below:
<!--<add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />-->


     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" ……………………=""


       SharePoint disable the default session module inside the <system. Webserver>\modules tag. To enable the module comment out the following line inside <system. Webserver>\modules as shown below:
<!--<remove name="Session" />-->


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


If you find the above error then follow the steps 4, 5 and6:
      Add the following tag inside system.web\httphandlers section
<system.web>
    <httpHandlers>
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </httpHandlers>
<customErrors mode="Off" />

     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=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    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………..

     I got an error while viewing the Report in sharepoint Page
                   

Issue: Report execution in the current AppDomain requires Code Access Security policy, which is off by default in .NET 4.0 and later. Enable legacy CAS policy or execute the report in the sandbox AppDomain.



To resolve this issue –

Add the following line to the web.config
...
<trust level="Full" legacyCasModel="true" />
...
</system.web>

2 comments: