Error when adding two ReportViewer 2012 Web control on page - by Edward Zhu

Status : 

  Not Reproducible<br /><br />
		The product team could not reproduce this item with the description and steps provided.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 751256 Comments
Status Closed Workarounds
Type Bug Repros 3
Opened 6/28/2012 1:48:26 AM
Access Restriction Public


When we add two ReportViewer 2012 controls (Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91) on the page, then the first ReportViewer can be shown properly, but the second one has the error, "Object reference not set to an instance of an object".

For more information, please refer to the TechNet thread:
Sign in to post a comment.
Posted by sandygettings on 3/22/2013 at 9:23 AM
Okay, this thread seems to be dead. I've submitted a new issue along with a sample project that reporduces the problem.
Posted by sandygettings on 3/17/2013 at 1:33 PM
Ok, I must be blind -- where go to I upload the file?
Posted by sandygettings on 3/17/2013 at 1:24 PM
Sorry it took so long to see your request, Matt -- I forgot to add this to my watch list. I'll upload a simple test case now.
Posted by Microsoft on 3/5/2013 at 7:57 AM
Thanks Sandy for validating the issue and providing a workaround. I'm still unable to repro the issue. Could you attach a zipped up solution that reproduces the issue?

Matt Jones
SSRS Tiger Dev
Posted by sandygettings on 2/27/2013 at 6:39 PM
I have the same problem and I developed a very simple test case to demonstrate it. It definitely looks like a Microsoft bug -- let me know if you want a copy of my example.

I also found a workaround that I've successfully tested in a few cases. Add a Refresh() for the second ReportViewer during the OnLoadComplete handler.

        protected override void OnLoadComplete(EventArgs e)
Posted by Microsoft on 1/28/2013 at 4:42 PM
Thanks for providing this information. Unfortunately, I'm unable to reproduce this issue. I created 2 simple reports, 1 with a parameter, the other with no parameters. Created a new web page with VS2012, added a ScriptManager and 2 ReportViewer controls. I pointed each RV control to one of the newly created reports. I'm able to run this in VS2012 debugger without any issues. Do your reports have images or background images? If so, try removing them from the report and check if that resolves the issue.
Posted by Renato Cazangi on 11/15/2012 at 4:08 PM
I have the exact same issue. You can have as many instances on page as you want: only the first one works properly on the first page load. Now if you click refresh on those that didn't work, they reload fine.

Differently than what was said though I used to have the same problem on ReportViewer 2010. However that one would show no error message at all.

If change AsynRendering to false, then all works fine.

I attached a event handler to OnReportError and got the following on stack trace:
        Source:    "Microsoft.ReportViewer.Common"    
Stack trace:
at Microsoft.Reporting.LocalService.Render(String format, String deviceInfo, String paginationMode, Boolean allowInternalRenderers, IEnumerable dataSources, CreateAndRegisterStream createStreamCallback)
at Microsoft.Reporting.WebForms.LocalReport.CreateSnapshot()
at Microsoft.Reporting.WebForms.ReportViewer.OnPreRender(EventArgs e)

+        TargetSite    {Microsoft.ReportingServices.ReportProcessing.ProcessingMessageList Render(System.String, System.String, System.String, Boolean, System.Collections.IEnumerable, Microsoft.ReportingServices.Interfaces.CreateAndRegisterStream)}    System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}