I'm trying to choose between ClosedXML, EPPlus, and possibly SpreadsheetLight. What reasons might I consider for picking one over the others?
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.
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");
}