views:

326

answers:

4

Hi!

I'm trying to use ReportViewer (it must be ReportViewer!) with Asp.NET MVC. Is it possible?

Thanks!!!

+1  A: 

You can use a webform for that or use the SOAP functionality

Fredou
problem is only with MVC webforms mishmash
Perpetualcoder
A: 

Any control that does not use ViewState or require runat=server can be used in ASP.NET MVC without problems.

The construction of ASP.NET MVC allows report writing in a view to be a relatively straightforward proposition.

Robert Harvey
Still I don't how to integrate with MVC... it's what I want to know..
AndreMiranda
See this question: http://stackoverflow.com/questions/367332/would-the-msft-report-viewer-rdlc-work-with-mvc
Robert Harvey
+1  A: 

Report Viewer requires view state, and you do not have that in ASP.Net MVC.

There are two ways to do this.

  • Have one page on you site that is a normal web page and use that to display the report viewer.
  • Let your asp.net MVC page call your report server and then stream out the Http response to the client (we use this for PDF reports)
Shiraz Bhaiji
A: 

You will want to put the report viewer on a Web Form. Check out the second section on this page.

http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc

Jeremy