Render Webform in ASP.Net MVC

Asked

Viewed 289 times

1

I need to call a Webform from an Action on controller, I read a lot on the internet but I couldn’t make it work.

I followed the example at that link, where you ask to exchange your Webform inheritance System.Web.Mvc.ViewPage, if I do not change the error stating that the inheritance should be System.Web.Mvc.ViewPage, if I change the error below.

SS

  • I changed the Webform by an ASP.NET MVC4 (ASPX) page and it worked, the problem now is that when I try to pass the parameters it gives the following error: The viewer control object is in read-only mode

  • Why you have to necessarily use a Web Form with MVC?

  • I need to render reports that are on a server Reporting Services, and I did not find anything in MVC for this, in Webforms has the report Viewer, worked right, I just need to be able to call this page of my action.

  • You can call a report from the Report Builder by Controller MVC.

1 answer

1

As I could not render by the controller, I found that it is possible to call the report hosted in Reporting Services with Javascript.

javascript: void (window.open('http://srv-teste/ReportServer/Pages/ReportViewer.aspx?/Compras/Pedido&rs:Command=Render&param1=10&param2=20&rc:Parameters=Collapsed', '_blank'))

The option rc:Parameters=Collapsed causes the parameter prompt to be minimized.

  • This form is not quite the way it is done in MVC. The correct is to call the classes of Report Builder within the Controller.

  • I couldn’t do it that way, I did a lot of research and I couldn’t find a way to do it for the controller, I’ve actually been almost a week with it, if you’ve done it already and can post the code, or if you have a link that helps me.

  • I had an example, but it was a client code, and I don’t work with it anymore. If I can get something put up for you.

  • OK thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.