Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am new to Sharepoint. I need to know the best way to add a ReportViewWebPart to a page through C# code behind.

I have tried accessing the web part from WebPartCatalog. It leads me to the NullReferenceException.

Then I tried by creating instance for ReportViewerWebPart and add the properties for ReportPath, Title, etc., it leads me to Object Reference Not Set to an Instance of an Object exception.

But I could add other web parts to a page as normal.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.