Thursday, May 19, 2011

Different ways to create excel files

I Just analyzed the methodologies used to read/write excel files and listed the pros and cons below.

OpenXML (Office 2007 .XLSX)

Pros:

  • Reliable as this is a Microsoft’s product.
  • Native Excel format
  • Supports all Excel features
  • Do not require an install copy of Excel
  • Open XML SDK 2.o Productivity tool to generate code.

Cons:

  • Limited compatibility outside Excel 2007
  • Complicated unless you're using an expensive third party component

NPOI

Pros:

  • Easy to use and similar to existing SyncFusion code.
  • Do not require an install copy of Excel
  • Excel Chart, Pivot Table, Auto filter on columns, Insert images in header or footer are supported in NPOI 1.2.3 and later versions.
  • Supports Office Open Xml (OOXML) format also.(using ExcelPackage)

Cons:    

COM Interop

Pros:

  • Uses native Microsoft libraries
  • Read support for native documents

Cons:

  • Very slow
  • Dependency/version matching issues
  • Concurrency/data integrity issues for web use when reading
  • Scaling issues for web use (different from concurrency): need to create many instances of heavy Excel app on the server
  • Requires Windows

SpreadSheetML (open format XML)

Pros:

  • Supports most Excel features: formatting, styles, formulas’, multiple sheets per workbook
  • Excel does not need to be installed to use it
  • No third party libraries needed - just write out your xml
  • Documents can be opened by Excel XP/2003/2007

Cons:

  • Lack of good documentation
  • Not supported in older versions of Excel (pre-2000)
  • Write-only, in that once you open it and make changes from Excel it's converted to native Excel.
  • Apart from these, there are some more third party tools available.
  1. Spreadsheetgear http://www.spreadsheetgear.com (License required)

They are claiming that it is faster than Open XMl SDK 2.0.  We can find a testimonial from MSN project manager saying MSN is using spreadsheetgear in the home page.

  1. Aspose (http://www.aspose.com/categories/.net-components/aspose.total-for-.net/default.aspx)  (License required)
  2. MyXlshttp://sourceforge.net/projects/myxls/ (Freeware)

No comments:

Post a Comment