Pages

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:

image

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

38 comments:

  1. Very helpful

    Regards,
    Ojas
    Http://ojasmaru.blogspot.com

    ReplyDelete
  2. hi ,after i get taht error i followed 5 ,6 ,7 but getting same error could you please what would be correct reason.

    ReplyDelete
  3. Hey ... this blog was really helpful. Thanks a ton for posting. Keep up the good work.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Awesome!!! Worked like a charm! The only thing that I had to different is to comment out the "ReportViewerWebControl" handler in system.WebServer\handlers instead of system.WebServer\httphandlers

    Also did not have to remove:

    Thanks again for the amazing post!

    ReplyDelete
  6. Thanks. Saved me.

    ReplyDelete
  7. Thanks... this got me over the last of my hurdles of getting a full SharePoint 2010 Enterprise setup with SQL 2008 R2 on my Windows 7 box.

    ReplyDelete
  8. too good. i keep getting all my sharepoint 2010 answer right here in this blog.

    ReplyDelete
  9. If you are still getting the same issue... Please refer to the below link

    http://praveenbattula.blogspot.com/2010/03/fix-to-report-viewer-problems-in-iis-7.html

    ReplyDelete
  10. Can anyone give me hand that which web.config file I need to update?

    ReplyDelete
  11. you web application configuration file. Go to the following directory in you iis server machine and select the web application port. Then you will find the configuration file.
    C:\inetpub\wwwroot\wss\VirtualDirectories

    ReplyDelete
  12. i get this error:
    An error occurred during the processing of /_CONTROLTEMPLATES/ReportViewer1/Emp/EmpUserControl.ascx. The base class includes the field 'ReportViewer1', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).

    ReplyDelete
  13. Amazing stuff...Thnx...
    --Varun Gupta

    ReplyDelete
  14. Helpful man, thanx. You made my day!!!

    ReplyDelete
  15. Really helpful man, Thanx

    ReplyDelete
  16. Kalo ketemu aku di indonesia, aku traktir mendoan.
    In English
    If I meet you in indonesia, I buy you mendoan.

    Thanks alot. :)

    ReplyDelete
  17. I'll give a try to have mendoan in Copenhagen. Need to find Indonesian restaurant. :-)

    ReplyDelete
  18. Thanxz a lot !!!!!!!!You have done a Tremendous work..Keep it up your good work....

    ReplyDelete
  19. thanks a lot Sohel..it worked for me also:)

    ReplyDelete
  20. Thanks for this great post, saved my life !

    ReplyDelete
  21. Report viewer control is not displaying.Plz suggest me

    ReplyDelete
  22. This is really wonderfull, Thanks Sohel.

    ReplyDelete
  23. I followed your instructions and I get this error.

    Report Server has encountered a SharePoint error. (rsSharePointError)
    The user does not exist or is not unique.
    The user does not exist or is not unique.

    ReplyDelete
  24. hi sohel ..
    sorry to ask you this silly question but where i will find appsettings in my visual studio 2010?
    i checked in app.config its not there and neither in web.config file in 14hive folder.
    Please suggest..
    Thank you,
    gurmeet

    ReplyDelete
  25. @Gurmeet, you can find web.config by going to 'administrator tools' -> 'IIS manager'. Then find the sharepoint site that need to configure. Right click on the site in IIS and click explore. This will open the root directory of the site directly where you can find the web.config file. Usually, the default path is 'c:\initput\wwwroot\..\'

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Hi Sohel,

    Your Blog :

    http://ranaictiu-technicalblog.blogspot.in/2010/04/sharepoint-2010-configure-rdlc-report.html
    It worked for me.

    You have mentioned many web.config changes . In our case we have 53 site collection under 1 web applications.
    and ADMIN team is not comfortable in deploying as we are commenting 2 entries and using 1 .

    can you please explain why to go for InProc mode and commenting key:

    and



    can you please tell how(if) will these 7 points explained by you will effect other site collections.
    its very urgent

    ReplyDelete
  28. Thanks a lot......
    Your article saved the day for me... ;)

    ReplyDelete
  29. How about sharepoint 2013..?? are we supposed to do the same thing as well...?

    ReplyDelete
  30. @Karu, I'm not sure about SharePoint 2010 as I've not tried it. But you can give a try - maybe the assembly details will be different

    ReplyDelete
  31. Thanks a lot. Good post......

    ReplyDelete
  32. Hi,
    I followed all above steps and I am receiving below error in sharepoint 2010. We have SSRS in Native mode, any thought on the issues ?
    Thanks in advance

    Error I am receiving:
    An error occurred during local report processing.
    Failed to load expression host assembly. Details: Could not load file or assembly 'expression_host_454e5ace13fe49f9bb341bac3da40cfc, Version=11.2.40219.29, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)

    ReplyDelete

Note: Only a member of this blog may post a comment.