Adding Reporting Capabilities to MVC? - asp.net-mvc

Background: I currently have a Web Forms, ASP.NET 3.5/C# application which I'm interested in converting to MVC 2. It's a relatively tiny app so the exercise shouldn't take too long. The two primary functions the appliction does is allow users to
1) view and enter their data - metrics
2) view output reports of this data aggreggated at a higher level.
This second point is of concern to me as my first impression of MVC is that most of the reporting tools do not work with it. I'm currently using ReportViewer for 2) but I read here and on other sites that configuring it to work with MVC is a pain.
Are there any other types of Reporting capabilities that I could use with MVC 2? Are there some that work "out of the box"?
Or in your experience of using MVC 2, would it be easier to put together your own report? My requirement is to make a report that is similar to ReportViewer's Matrix style, with a few merged cells and a drill down by two levels. Don't know if that's way too complicated to do with MVC from scratch or not.
EDIT: Bonus if you know of any other Reporting add-ons that work with MVC besdies ReportViewer.

I have used the RDLC local reports to do this but I don't use the report viewer (even in webforms). I always stream the report straight to PDF. This works great in MVC as well since in this case I am avoiding the report viewer control.
This tutorial/post shows how to stream in MVC.

Please check my tutorial about reportviewer and mvc2 -> How to use ReportViewer 2010 in MVC.NET 2
Hope it helps you

Related

Asp.Net MVC options for business reporting

I have a need to add business reporting for an application I am working on. I have found very little in the way of support for MVC natively. I would like to get a feedback on tools that people have used, how they used it (native or hybrid) and if possible links to examples demonstrating integration.
I'd like to get feedback on use of
Crystal Reports
SSRS
Telerik
MVC Reporting Solutions
SSRS - requires hybrid application with winforms page hosting the report
Telerik - ???
Crystal Reports - requires hybrid application with winformats page hosting the report
FASTREPORTĀ®.NET - has asp.net support but vendor has not tried and does not support MVC.
Here's what I did a couple years ago to get a SSRS report to run in MVC.
http://dvdtracker.livejournal.com/1810.html
Sorry for late reply, but I've found it when searching for the documentation regarding my project. Currently I use Perpetuum SharpShooter and it works in my MVC application well (after I spent some days to make it work as I need). Maybe it will be helpful for someone.
Telerik says their report viewer in the web forms product does actually work in MVC (they have a statement on their web site that the ASP.NET AJAX framework works in MVC with some special components, and I have used it in an MVC app and with what I've used, it does all work for me).
SSRS does work in MVC if you use web forms and do not use an MVC view; this is still a possibility. You have to setup the form as ASP.NET does for you, use a form with runat="server", etc. But I did get this to work.
I don't know about Crystal.

Replicate Webforms GridView in ASP.NET MVC

Is there a realistic way to implement a webforms stylegridview in ASP.NET MVC, with inline editing?
I have found various solutions to get a grid with inline editing working in MVC using JQuery add-ins but so far they have been very messy, require an unrealistic amount of work and that all gets worse when you want to add client and server side validations.
I develop a lot of sites that have fairly extensive administration sections to them. So far I have spent longer doing one page with MVC (which still does not work) than I would have doing the whole administration section of a site. Grids with inline editing work really well for somethings, say maintaining a list of countries and marking some as active or inactive. I know I can easily make this open a "details/edit" page, or even handle it with an AJAX popup, but neither of these options provides as clean a user experience as inline editing for things this simple.
Has anyone found an easy way to achieve inline grid editing or do I need to go for a hybrid MVC / winforms site (which I really didn't want to do).
Thanks
Andrew
The Java Script Framework Ext JS has some good support for all different types of grids. This is something you could easily use with ASP .NET MVC, I'm sure there are some other solutions both client and server side out there as well.
I have had luck with incorporating Dynamic Data with ASP.NET MVC for just this very purpose. This hybrid solution can give you all the perceived benefits of a foward facing MVC site while giving you a quick and easy way to create CRUD functionality on all your data for admnistrative purposes. To be honest, if your user base isn't that large, designing the whole application in Dynamic Data is a legitimate option, especially once you get comfortable enough with it to use it past its basic "scaffolding" abilities.
As far as actually finding a packaged solution for providing ASP.NET GridView functionality in ASP.NET MVC, good luck. I have yet to find any solution that doesn't require some sort of melding with javscript frameworks or incomplete solutions like those offered by MVC Contrib. If you do find one, please let me know.

ASP.NET MVC plus Silverlight

It seems to me that, for structured development with both depth and breadth of capability, ASP.NET MVC and Silverlight have the potential to make a nice powerful framework with superior UI granularity and reduced AJAX exposure. Have any of you tried building such a stack with future durability in mind?
ASP.NET MVC and silverlight?
In some ways, it is an either-or choice - your data is displayed either in html/css/js generated by ASP.NET, or in Silverlight. Why mix them? I'm sure that ASP.NET MVC is a good way to deliver Silverlight, but that doesn't necessarily make it part of the same UI.
It's generally about reach vs. richness. A web UI with no Silverlight or Flash can reach more users, but one with Silverlight can have a richer UI. Silverlight is good fun to code in, and I have seen some wonderful apps using Silverlight's streaming video features, but if e.g. you are doing data entry and display, and you don't need the richness of Silverlight, then why not keep the reach and stay in Asp.Net?
If you are going to do the UI in silverlight it makes sense to do all of it in Silverlight. I have had good experiences with all the ViewModel-view-controller page flow happening inside the Silverlight app, rather than transitioning to another html page and loading a different silverlight app. It's faster and you can do fancy transition or fade-in effects in Silverlight's XAML markup.
Why is "reduced AJAX exposure" a desirable goal? Sites like e.g. Stackoverflow here use AJAX techniques to very good effect.
Stephen Walther's talk at MIX09 shows four pillars of ASP.Net as it currently stands - Forms, MVC, AJAX and Dynamic data. A lot of people are Seeing it as "moving from forms to MVC" but there are other approaches also being developed in the mix.
I've built a little test app with SL and MVC. It didn't work that well but I don't think I was doing right. I've tried using SL in views but its slow to switch pages since its loading new SL instances all the time. I've tried a single SL app which meant it contained all the control code as well but that relegates the server to data access which only needs some WCF/Web service code no need for MVC there.
It may work better if we dispense with the idea of there being many view pages. In my next iteration I shall be using controllers to respond with XML or JSON directly to requests from a Silverlight app which contains the views. However this approach would still leave some questions unanswered, for example, how does the controller get to have a say in what view is actually displayed?
To be honest, I'm getting the feeling that SL to ASP.NET-MVC are yet shaping up as a good match. Some web apps may benefit from some SL elements (charting for example) yet the app remain firmly in HTML. On the other hand, an app whose UI is purely in SL (whilst internally using some similar View/Controller concept) doesn't really need MVC on the server-side.
Its early days, it will take while for us early adopters to see what really works and what doesn't. There being a beta for version 3 with more coming from MS in the way SL can access serverside data may change things further.
I asked a similar question here: Does Silverlight 3 Change the MVC vs. Silverlight question. This was in response to SL2 vs. MVC where folks all agreed that they were complimentary technologies. I'm still not convinced. My experience has been similar to AnthonyWJones. Per the previous posts, I tried to mingle them without a lot of success. Could be my own ignorance, though. Right now I'm building a Silverlight only application using SL3 beta. I seem to be a lot closer to my intended effect. That being, an application with a few database features. So it didn't make sense to build a completely stand alone app (since the data is central), but I really wanted some Silverlight goodness to render the end result and allow the user to interact.
So where in the hell am I going with all of this? Based on my experience, this still seems like a YMMV type question. It really depends on what you're trying to build. Since I'm light on database, heavy on interaction, I'm biting the bullet with Silverlight 3 and .NET RIA Services for the little database stuff. If I were writing Stackoverflow, I'd probably do ASP.NET MVC and AJAX.
We are currently using ASP.NET MVC as an alternative to WCF to expose data to Silverlight where our Silverlight app makes RESTFUL calls to urls in our Mvc application and the controller returns a JsonResult which works well for us. It's by no means necessarily the text book way but we found this way the two technologies compliment each other. Now if we ever need an HTML implementation we've already done the Model-Controller work which can be re-used.

Telerik controls in ASP.NET MVC

Telerik claims their controls work with ASP.NET MVC now. Has anyone already used the controls in a MVC project?
My company uses the Telerik ASP.NET controls in a large application and it works out quite well. That's why we think about using them in a MVC project.
EDIT 1:
telerik has a new go at ASP.NET MVC this looks much better then their first go at it. But it was to late for my project. http://www.telerik.com/products/aspnet-mvc.aspx
You could check out the demo application (a forums application) they built using ASP.NET MVC, announced here. Source code is available.
The demo is a simple- and stylish -
forums application. It uses 9 of the
RadControls, including RadGrid,
RadEditor, RadChart, RadTreeView and
RadUpload, to build a forum site that
has basic thread/post navigation,
formatted forum posting, user
authentication (with support for
custom avatars), and a site activity
"Statistics" view. Everything you need
to have a fully functional MVC forums
app. The source is available for
immediate download, so I encourage
anyone interested in learning more
about MVC or the RadControls in MVC to
grab the bites and study the example.
You may have already seen it, but Telerik has a blog post about how to use their controls with MVC and some of the limitations. I don't actually use their controls so I can't speak to whether the limitations are really a problem. It does appear that there is a a little more "manual lifting", so to speak, when using the controls with MVC but that there are workarounds to get most of them to work properly.
I'm hoping that they will eventually release MVC versions of their controls. I'm holding off evaluating them until that happens, but if you're already using them I'd certainly look to see how easy they would be to use with MVC. Perhaps you could update your question with an answer if you give it a try and let the rest of us know how it went.
I have been using the Telerik controls for about 6 months. I have been using the Grid and Window controls on MVC 2. Like most commercial products there are issues we have been fortunate to work them out. Once you get past the initial learning curve the controls are time savers. You can't beat the price for the amount of functionality you get.
My biggest issue is that they seem a bit sluggish responding on their forums. Maybe I'm just asking lame questions. I've been lobbying management to pay the $ for the supported version. Considering the amount of time we spend digging around to solve some of the more complicated problems I think it would be worth it.
I've just had a look at their grid and wrote a small POC project with it and must say I'm quite impressed. I'm not sure about their previous MVC controls iterations, but the current one can be a real time saver. It also fits very nicely into ASP.NET MVC ajax applications since there is a rich client-side API. Having jquery DataTables on the client side results in an even better user experience (because it is much faster), but also requires more error-prone javascript code.
As an alternative, you can check for MDBootstrap (itĀ“s a front-end framework built on top of Bootstrap). There you will find an article with free ASP.NET MVC templates.

ASP.NET MVC & Expression XAML - How do I integrate?

Some Background:
ASP.net MVC is primarly a paradigm shift in the way you structure and develop ASP.NET applications. Shifting from a "code behind" type of mentality to more of a standard MVC Ruby on Rails like mentality. I applaud it's efforts as a simlifying tool towards unit testing ease and seperation of code (although the html inline code could be debatable).
Expression and XAML is a way to describe the presentation layer that can be simple for designers.
The question is:
If we are to use ASP.NET MVC in developing our next website how does the design team that uses Expression and XAML supposed to create (V)iews or integrate into the development flow?
More specifically can Expression users still operate in an ASP.NET MVC world?
Note that the pages in Expression's model use a code behind paradigm as well.
It is a hack, but you can use XAML to render static images in ASP.NET MVC. Check out my post XAML Meets ASP.NET MVC - Serverside Image Rendering - that shows how to render XAML and WPF controls as an image in ASP.NET MVC
http://amazedsaint.blogspot.com/2010/07/xaml-meets-aspnet-mvc-create-databound.html
There is also the MvcXaml project that is a View Engine that allows for images to be dynamically generated based on a XAML view.
http://mvcxaml.codeplex.com
I will try to answer this, making several assumptions that may be wrong.
ASP.Net MVC is a web technology and XAML is a desktop one. You can use XAML inside Internet Explorer, but it's basically a hack, it works best for desktop or silverlight applications.
If you want a paradigm similar to MVC for the desktop, you should try the M-V-VM pattern, who is more appropriate to WPF and XAML.
With M-V-VM you can create views almost code-behind free.
A great intro to M-V-VM is this video by Jason Dolinger
If you are making a website using MVC and you are trying to integrate the design team, you should let them create the HTML+CSS views of your site, while the developers create the controllers and the models.
Please comment in this answer if I have misinterpreted the question.
I'm currently banging my head on these terms. However, maybe this silverlight-as-a-view-in-aspnet-mvc article will help? You've asked about XAML, and I thing this is what Silverlight uses...

Resources