Skip to content
MVC Extensions for ClosedXML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Upgrade Microsoft.AspNetCore.All to avoid vulnerability at aspnet/Ann… Oct 23, 2018
.gitattributes
.gitignore
LICENSE
README.md Add link to ClosedXML Jun 5, 2017

README.md

ClosedXML.Extensions.Mvc

MVC Extensions for ClosedXML

Install via NuGet

To install ClosedXML.Extensions.Mvc, run the following command in the Package Manager Console

PM> Install-Package ClosedXML.Extensions.Mvc

Usage

In your MVC controller define an action that will generate and download your file:

public ActionResult Download()
{
    using (var wb = GenerateClosedXMLWorkbook())
    {
        // Add ClosedXML.Extensions in your using declarations
        
        return wb.Deliver("generatedfile.xlsx");
        
        // or specify the content type:
        return wb.Deliver("generatedFile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
    }
}
You can’t perform that action at this time.