No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src Upgrade to ClosedXML 0.93 Jun 29, 2018
.gitattributes First commit May 14, 2018
.gitignore First commit May 14, 2018
LICENSE Initial commit May 14, 2018 First commit May 14, 2018


WebApi 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.WebApi


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

public class ExcelController : ApiController
    public async Task<HttpResponseMessage> DownloadFile(int id)
        var wb = await BuildExcelFile(id);
        return wb.Deliver("excelfile.xlsx");

    private async Task<XLWorkbook> BuildExcelFile(int id)
        //Creating the workbook
        var t = Task.Run(() =>
            var wb = new XLWorkbook();
            var ws = wb.AddWorksheet("Sheet1");

            return wb;

        return await t;