0

I am looking for a c#/.net excel parsing library that can deal with files uploaded from end users, that may have quirks

We are currently using ExcelDataReader but it has some serious shortcomings when dealing with excel files from the wild.

I am looking for an excel parser that can:

  1. Handle files in memory stream, and parse them to a net type
  2. Be able to process 2000+ rows
  3. support 1900/1904 (pc/mac) date formats
  4. Be able to at least some extent without errors handle merged cells
  5. Be able to at least some extent without errors handle formula fields
  6. Be able to at least some extent without errors handle collapsed columns

Nice to have:

  1. Be able to open xls, or other formats
  2. Have a decent performance
  3. still an active project

It would be OK if this was a paid product, but in that case it would be hard if it did not have a demo

1

You can use Excel itself. It has built in very rich object model, that you can use through COM to .NET interop.

There are however 2 drawbacks:

  • you need Excel license on server
  • Excel is single threaded, so you need to queue uploaded files and process them by separate script, outside http server

However, no matter which library you choose, you should queue uploaded files anyway for security reasons, so 2nd drawback isn't really a problem.

And the benefit is that by using original Excel you have 100% compatibility with uploaded workbooks.

0

Best library our company have been using is closedxml

You declare and initialize the object with the constructor. Collect your data, put them in your datatable, and convert your datatable to excel. Performance is pretty good. In case you use example million lines, i would prefer to add new sheets, in case excel wont go for Overflow in RAM. Best thing, it is free, open source.

XLWorkbook wb = new XLWorkbook();
DataTable dt = GetDataTableOrWhatever();
wb.Worksheets.Add(dt,"WorksheetName");
  • Could you be more specific on the special requirements stated in the question? Almost any library can create a new workbook and add a worksheet. How about 1904 data times? – Thomas Weller Jan 30 '15 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.