Writing an Excel file in EPPlus

前端 未结 3 1740
青春惊慌失措
青春惊慌失措 2021-01-31 17:45

I have been stuck on this for days and despite all of the help out there, none of these solutions have been working for me. What I want to do is create an excel file using the E

3条回答
  •  无人及你
    2021-01-31 18:34

    Have you looked at the samples provided with EPPlus?

    This one shows you how to create a file http://epplus.codeplex.com/wikipage?title=ContentSheetExample

    This one shows you how to use it to stream back a file http://epplus.codeplex.com/wikipage?title=WebapplicationExample

    This is how we use the package to generate a file.

    var newFile = new FileInfo(ExportFileName);
    using (ExcelPackage xlPackage = new ExcelPackage(newFile))
    {                       
        // do work here                            
        xlPackage.Save();
    }
    

提交回复
热议问题