Avatar of Wayne Atherton
Wayne Atherton

asked on 

ASP.NET ReportViewer from WebMethod.

I need to call a ASP.NET `ReportViewer` from a `WebMethod`. I've can successfully call the method, that creates the method, but when a call `reportName.Reset();` I get the following error:

{"Object reference not set to an instance of an object."}

Which basically means, the control hasn't been loaded yet into the DOM. So, I've tried using the `page.LoadControl` function, but I cant seem to get this to work:

     Page page = new Page();
     ReportViewer viewer = (ReportViewer) page.LoadControl(rptViewer);

This produces the following error, which I can't find elsewhere on the internet:

Argument type 'Microsoft.Reporting.WebForms.ReportViewer' is not assignable to parameter of type string
jQueryC#ASP.NETWeb Languages and StandardsWeb Development

Avatar of undefined
Last Comment
Pavel Celba

8/22/2022 - Mon