Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between the EPPlus and ClosedXML libraries for working with OpenXML? [closed]

Tags:

I'm trying to choose between ClosedXML, EPPlus, and possibly SpreadsheetLight. What reasons might I consider for picking one over the others?

like image 226
llasarov Avatar asked May 08 '12 15:05

llasarov


People also ask

What is ClosedXML library?

ClosedXML is a . NET library for reading, manipulating and writing Excel 2007+ (. xlsx, . xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.

Is ClosedXML open source?

ClosedXML is an open source library created based on OpenXmlSdk. It's more user friendly. ClosedXML is a . NET library for reading, manipulating and writing Excel 2007+ (.

What is Documentformat OpenXML?

The Open XML SDK provides tools for working with Office Word, Excel, and PowerPoint documents. It supports scenarios such as: - High-performance generation of word-processing documents, spreadsheets, and presentations. - Populating content in Word files from an XML data source.

Does ClosedXML require Excel?

ClosedXML. Report is a . NET-library for report generation Microsoft Excel without requiring Excel to be installed on the machine that's running the code.


2 Answers

I've been evaluating EPPlus, ClosedXML, and SpreadsheetLight over the past week. All three are really great libraries that make working with the extremely convoluted OpenXML a breeze. I've decided to go with EPPlus for the following reasons:

  • Initially, I was going to go with ClosedXML. It has great documentation and the object structure made a lot of sense to me. I have some charting requirements though and as of right now, ClosedXML doesn't have any charting functions.

  • Then I stumbled upon SpreadsheetLight which also has good docs and does support some charting. I also like the author's attitude and his commitment to his product. However, the project is built on top of the OpenXML 2.0 SDK, not 2.5, which is a deal breaker for me because I want to have the flexibility to work directly with OpenXML in the event that the library doesn't quite meet my needs. My project is targeting excel 2013 so I want to have the latest SDK to work with. ...Update! See ErrCode's comment below for additional info...

  • Finally, I came across EPPlus which has okay documentation and supports charting. It is has been downloaded far more times than the other two which gives me some security in knowing that others are using it and the community seems to be active around the project. They are also currently on beta 2 of version 4 which sounds promising from what others are saying. I'm also getting the gist that EPPlus has good performance (not that the others are necessarily bad) and the upcoming version 4 seems to be improving on that further.


Update

Another very useful feature I've found included with EPPlus is how it exposes the XML for the various parts of the worksheet. If there's a feature that is not supported by EPPlus, you can still edit the XML (in some cases) to get the desired output. For example, if you have a pivot chart and want to enable multi-level labels, you can do the following:

    private void EnableMultiLevelLabels(ExcelChart chart)     {            var element = chart.ChartXml.GetElementsByTagName("c:catAx")[0];         if (element == null)             return;          var multiLevelLabelNode = element.AppendChildElementNode("c:noMultiLvlLbl");         if (multiLevelLabelNode != null)             multiLevelLabelNode.AppendNodeAttribute("val", "0");     } 
like image 126
Chris Avatar answered Sep 24 '22 21:09

Chris


SpreadsheetLight, and it runs internally on Open XML SDK. MIT License. Disclaimer: I wrote SpreadsheetLight.

like image 31
Vincent Tan Avatar answered Sep 20 '22 21:09

Vincent Tan