Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
Choosing between webforms and MVC
posted

Hi,

We are migrating a windows based application that is composed mainly of reports in both excel and pdf to a web based application. We will like to display some values in a grid and give the user the option of exporting. The question is would it be easier to implement it as a Webforms or an MVC application.

Thanks, Jayson

  • 20255
    Offline posted

    Hello Jayson,

     It has been some time since your post, however in case you still need assistance I would be glad to help. It will be easier if you use WebForms, because there is a WebExcelExporter control that allows you to automatically export Grid data. No matter what kind of Infragistics DataGrid you are using (WebDataGrid or WebHierarchicalDataGrid), you can easily achieve your goal to get the data into an Excel™ file, in the format of your choice.

     With MVC you will need to use excel library. Iterate through all igGrid rows, create an excel object in memory (Manually define Workbook and Worksheet objects, set the style, add columns and fill them) and write it to a response stream.

     Some useful references regarding your question:

    WebForms - Export WebDataGrid, WebExcelExporter control

    MVC - Create Excel Worksheet, Exporting igGrid Data to Excel, Using the Infragistics Excel Engine

     

     If you have some other question, please feel free to contact me!

  • 65
    Suggested Answer
    posted

    In my opinion, almost everything is easier in MVC than in classic Webforms. It is really more of a personal preference and where your development skills are with both frameworks though. The best thing would be to make sure you have separation of concerns, and make sure your reporting data is encapsulated from the UI. Then you can create your UI in either framework, which would call your custom framework for getting the reporting data, pulling a report back in excel, pdf, etc. When the UI gets back an excel file, pdf file, or set of data, it can then send the file to the browser for downloading, or bind the data to whichever grid you are using in your UI.