Microsoft ReportViewer in Sharepoint
Posted on 2011-03-10
I have a creating a .aspx page in VS2008 with a reportviewer control and a .rdlc report file with the data coming from a DataSet.XSD file. This report is connecting to a SQL server. When i run the page on my development machine everything works great. But when i place the file in the web directory inside sharepoint it gives me this error:
The control type 'Microsoft.Reporting.WebForms.ReportViewer' is not allowed on this page. The type is not registered as safe.
I added the assembly Microsoft.Reporting.WebForms to the web.config file in the web directory. I also added the SafeControl tag for the assemly.
<add assembly="Microsoft.ReportViewer.WebForms, Version=220.127.116.11, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<SafeControl Assembly="Microsoft.ReportViewer.WebForms, Version=18.104.22.168, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" TypeName="*" Safe="True" AllowRemoteDesigner="True"/>
When i added the safecontrol tag the page gives me this error:
This page has encountered a critical error. Contact your system administrator if this problem persists.
Are there other steps i need to do inorder to get the report viewer to work on a sharepoint page??