locked
Exporting data to excel RRS feed

Answers

All replies

  • User-821857111 posted

    I tried out this Web Forms way: http://aspsnippets.com/Articles/Export-GridView-to-Excel-in-ASPNet-with-Formatting-using-C-and-VBNet.aspx, which again worked well on my dev server but I'm not sure how one could mix Web Forms & Web Pages.

    You can add a .aspx file to a web pages site, but if you are happy to generate HTML with a .xls file extension, there is a way to do that within the Web Pages framework: http://www.mikesdotnetting.com/Article/204/Exporting-The-Razor-WebGrid-To-Excel. Note, doing this will cause a warning message to users with Office 2007 or newer about formats not matchng file extensions. So long as your users are happy to ignore that, it should do for you.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 26, 2013 3:11 PM
  • User-981963818 posted

    Thanks for the quick and easy answer Mike. I never tried that way because I didn't think it would be ideal. It turned out to be just what I needed. I can look to other solutions as I learn more, but this is a great start.

    Thanks again for your help.

    Thursday, September 26, 2013 3:37 PM