Link to home
Start Free TrialLog in
Avatar of Muralidharand
MuralidharandFlag for India

asked on

Microsoft ReportViewer in Sharepoint

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=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

<SafeControl Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, 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??
Avatar of Ted Bouskill
Ted Bouskill
Flag of Canada image

Well for one a typical ASP.NET page won't run natively in SharePoint.  Was there a web link that convinced you this would work?
ASKER CERTIFIED SOLUTION
Avatar of Muralidharand
Muralidharand
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Muralidharand

ASKER

Please review
Be aware that with an upgrade or even update to SharePoint your manual changes to the web.config file can be wiped out.  SharePoint likes to *own* the configuration files and DLL's used in the installation.
We have to add Reportviewer control in the safe control list in sharepoint web.config file.