[CLOSED] Export data to excel in EXT NET MVC

  1. #1

    [CLOSED] Export data to excel in EXT NET MVC

    Hello, I am new here and I have a question, I would like to know if you can export the information from a GridPanel to an Excel in Ext.Net MVC, I have seen that it is possible for WebForms but I do not see examples for MVC.
    Last edited by fabricio.murta; Mar 13, 2020 at 2:39 AM. Reason: Answered.
  2. #2
    Hello @pvera!

    The MS-Excel export you may have seen in WebForms (where did you see that, do you have a link? was it in our examples explorer?) uses third-party libraries/software to do so. It simply passes back the data of the grid panel to the third-party software to generate the document in proprietary format.

    Two ways I know about doing that is by using the XSL Transformation (xslt), and the Microsoft Office Interop.

    This means the technology is all WebForms, MVC and Ext.NET agnostic. You get the data to code behind and process it into an MS-Excel file. If this sounds too complicated, you may be able to work with just .csv as well.

    Furthermore, you should be able to, given you found an example using what you need in WebForms, to rather easily be able to port that into MVC scope.

    Whenever possible, if you mention something you seen in one example among our examples explorer, please share also a link to said example for clarity; it may unveil information that would help us further help you.

    Hope this helps!
    Last edited by fabricio.murta; Mar 12, 2020 at 2:54 PM.
  3. #3
    Thanks for reply Fabricio,

    The example link is as follows https://examples5.ext.net/#/GridPane...ort_Data_Ajax/.

    And if I manage to do it in MVC with XSLT but now I would like to know if it is possible and how to customize the file.
  4. #4
    Hello again, @pvera!

    Some time back, while working with XSLT, I had issues having it output files in the new Excel format (XLSX), and I didn't really work a lot with the technology, but it felt pretty limited as to how much it could express in terms of the output XLS file.

    But in the other hand, for what I know about the Office interop model, you can do pretty much anything you could in the graphical interface via the C# one. In fact, you can not only output XLS files from it, but also author powerpoint presentations, word documents... But there's a lot of reflection (or at least was when I worked with that) involved. It may be as powerful as complex in algorithms.

    We can't have examples on office interop in our Examples Explorers because it requires licenses to run. I'm afraid I'm not certain which licenses you need, that's a matter for the company owning the product -- Microsoft.

    Again, these are third party technologies and are not directly involved with Ext.NET. The most you would need from this is, say, if you want to export a grid matching displayed columns and column orders, these could be passed by Ext.NET to code behind (you may need to pass them as extraParameters). In other words, the interface, the outline from the Ext.NET view you may want to use in your output file. As for the output per se, it is all due with either XSLT and MS-Office Interop.

    There may be other technologies out there for the same objective (output XLS or XLSX files) that could better fit your needs; it is just outside our scope and we simply are not aware of them.

    Disclaimer: The above experience and information about XSLT and MS-Office Interop is mine, Fabricio's. In no way Ext.NET or Object.NET is endorsing either technology as their "official". In fact, what technologies you use to generate file reports is not covered by Ext.NET, you're free to use any tool you rightfully hold rights for.

    In short, and objectively responding your inquire: It should be possible to customize the file, but it is up to the third-party tool you're using, the extent of customization you can attain.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Thanks for your answer.
  6. #6
    Hope it helped!

    Assuming it did, I'm marking this thread as closed. Please let us know otherwise.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Export to Excel - MVC
    By registrator in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 29, 2014, 11:20 AM
  2. Replies: 13
    Last Post: Sep 26, 2013, 10:04 AM
  3. [CLOSED] close Ext.Net Window after export to excel
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 04, 2013, 12:06 PM
  4. MVC Razor - export data to excel or csv
    By Ishrath in forum 2.x Help
    Replies: 4
    Last Post: Nov 14, 2012, 11:39 AM
  5. Problem with MVC and Export to Excel
    By reyonlines in forum 1.x Help
    Replies: 3
    Last Post: Apr 03, 2012, 10:44 AM

Posting Permissions