Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp net core export to Excel

I'm not sure that this kind of question can be posted here, but I think that it might be interested to many programmers. I need a package that would provide me with an interface for creating Excel files. I looked up on nuget and found several packages, but not a single one that supports asp net core.

like image 866
Marko Avatar asked Feb 17 '17 11:02

Marko


2 Answers

Little bit of thread necromancy here; however I wanted to share some other options that I found for any of the other search explorers out there.

ClosedXML

  • Uses AlphaNumeric Cell navigation e.g. ws.Cell("B2").Value = "Contacts";
  • Has a large amount of documentation and How To's
  • This is only for excel spreadsheets and does not have support for other Microsoft file types.
  • To install use PM> Install-Package ClosedXML

NPOI

  • Uses Numeric Cell navigation e.g.

    var rowIndex = 0; IRow row = sheet1.CreateRow(rowIndex); row.Height = 30 * 80; row.CreateCell(0).SetCellValue("this is content");

  • Supports read/write for xls, doc, ppt files.
  • To install use nuget: Install-Package DotNetCore.NPOI

EPPlus.Core

  • This is an unofficial port of the EPPlus Library to .NET Core.

somewhat relevant:

Datatables.net

I need a package that would provide me with an interface for creating Excel files.

I am not certain if you are displaying this data and are looking for a way to export it to excel but this could be an option as well if you are attempting to allow this in either an admin or public view. There are options available for customizing the output via a callback if the default output is undesirable.

  • DOM Structure documentation
  • Export Buttons
  • Excluding Specific Columns
  • Customization of Excel Export
like image 159
3 revs Avatar answered Oct 11 '22 14:10

3 revs


Please find Open XML SDK.

I'm using v2.5 with ASP.NET Core + .NET4.6, but as far I know the latest version v2.7 has added support for .NET Standard 1.3 - please read the change log.


More info:

  • Where to get the NuGet package
  • Documentation
  • Open XML SDK 2.5 for Office
  • Official releases of the NuGet packages for the Open XML SDK
like image 39
Lukasz Mk Avatar answered Oct 11 '22 15:10

Lukasz Mk