ASP.NET 5 Excel Export using Open XML
C#
Latest commit d3647f5 Sep 1, 2015 @anuraj Created Readme file
Permalink
Failed to load latest commit information.
Controllers Initial Commit Sep 1, 2015
Models Initial Commit Sep 1, 2015
Properties Initial Commit Sep 1, 2015
Views Initial Commit Sep 1, 2015
wwwroot Initial Commit Sep 1, 2015
Dockerfile Initial Commit Sep 1, 2015
HelloMvc.xproj Initial Commit Sep 1, 2015
README.md Created Readme file Sep 1, 2015
Startup.cs Initial Commit Sep 1, 2015
project.json Initial Commit Sep 1, 2015
project.lock.json Initial Commit Sep 1, 2015

README.md

ASP.NET 5 Excel Export

This repository contains sample code for implementing Excel Export in ASP.NET 5 using Open XML SDK.

  • Modify the project.json file and include Open XML SDK reference.
"dependencies": {
  "Microsoft.AspNet.Diagnostics": "1.0.0-beta6",
  "Microsoft.AspNet.Mvc": "6.0.0-beta6",
  "Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
  "Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
  "Microsoft.Framework.Logging.Console": "1.0.0-beta6",
  "DocumentFormat.OpenXml":"2.5.0"
},
"frameworks": {
   "dnx451": {
       "frameworkAssemblies": {
           "WindowsBase":"4.0.0"
       }
  }
}
  • Implement the Excel export logic. You can find a Data table version in SO
  • This repository contains generic one which supports normal POCO classes.
  • For re-usability can create a ExcelFileResult class, which helps to return Excel files as output.