views:

3366

answers:

6

I am interested in learning MVC, and have experimented with a couple of the sample apps. As a project, I'd like to move part or all of my own office app to MVC. An important part of this app, and of ALL of my apps for customers, is the printing of invoices, purchase orders, inventory lists and so forth. In fact, one of their main criteria for judging what we do is the appearance of these documents and their incorporation into the app in a practical, intuitive way.

It's impossible for me to get by without a report writer. The MSFT report viewer used to produce rdlc reports has been sufficient, and even comes up better than the competition in a couple of key areas.

Does this control work with an ASP.NET MVC application?

A: 

I don't see any reason why is won't work. ASP.Net work the same way is it you were using Web Forms. The only thing you don't get is the Postback, which I don't think is necessary if you are just rendering a report in your page.

tdavisjr
+1  A: 

Assume controls don't work until you can prove otherwise.

In MVC, there is no server-side form, no post back, no view state. If the control relies on any of these things -- and most do -- then it won't work properly in MVC.

Brad Wilson
+3  A: 

"ASP.NET ViewState has been disabled. The Report Viewer control requires that ViewState be enabled." if you run the report viewer from a view.

But you can run a webforms page in the same project. Ugly, but it works.

And you could try this too: http://weblogs.asp.net/rajbk/archive/2006/03/02/How-to-render-client-report-definition-files-_28002E00_rdlc_2900_-directly-to-the-Response-stream-without-preview.aspx

Matt Hinze
+1  A: 

It should run just fine. ASP.NET MVC and webform apps can live alongside each other.

http://www.chadmyers.com/Blog/archive/2007/11/30/asp.net-webforms-and-mvc-in-the-same-project.aspx http://talk.robertmao.com/2008/01/13/co-exist-of-aspnet-mvc-and-web-forms/

ajma
A: 

Take a look at using the SRS web services to render your report if you're bent on exclusively using MVC in your project.

A: 

Yes it will

Running ASP.NET Webforms and ASP.NET MVC side by side

http://weblogs.asp.net/rajbk/archive/2010/05/11/running-asp-net-webforms-and-asp-net-mvc-side-by-side.aspx

Raj Kaimal