Solved

Microsoft ReportViewer in Sharepoint

Posted on 2011-03-10
5
1,032 Views
Last Modified: 2012-05-11
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??
0
Comment
Question by:Muralidharand
  • 3
  • 2
5 Comments
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 35103082
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?
0
 
LVL 1

Accepted Solution

by:
Muralidharand earned 0 total points
ID: 35196885
I have added the Reportviewer control in the safe controls and it is started working....
0
 
LVL 1

Author Comment

by:Muralidharand
ID: 35196892
Please review
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 35200212
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.
0
 
LVL 1

Author Closing Comment

by:Muralidharand
ID: 35229997
We have to add Reportviewer control in the safe control list in sharepoint web.config file.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question