views:

4706

answers:

15

Open-source or not. What's your experience using it? How's the learning curve?

A: 

You could just hook into the Excel object library and manipulate the excel spreadsheet right through the object model.

mattruma
unfortunately this is too slow normally.
Anonymous Type
+5  A: 

If you don't need native excel spreadsheets, you can use a tool like Carlos Aguilar Mares ExcelXMLWriter. This has a fairly easy to understand object model, and is MUCH faster than using the Excel COM objects. There is also no dependency on Excel being installed on the machine, and you don't need to worry about marshalling and all that.

AlexCuse
A: 

We use Essential XLSIO from SyncFusion. It is not free, but it has worked well.

http://is.gd/3wpG

RTipton
+3  A: 

For parsing an Excel file, Excel itself is the best. It has a great object Model you can access via a COM interface.

For creating Excel, you can also use Excel, Or just create HTML or CSV file. This depends on your needs.

Excel is a bit heavy (read bad performande and memory consumption) for using it in a ASP.Net environment. If you need it for a desktop application however, you should use Excel itself. I'm doing this myself, and have found only minor troubles. It's very well documented on the MSDN site.

GvS
The offramp to programming hell is marked "Excel COM object model."
rp
The richness of the Excel API can be a bit overwhelming. But you can easily "record" a big part of your logic first, this makes it more easy.
GvS
@rp, "Excel Component Object Model object model"?
Petey B
+1  A: 

I second CarlosAG library, it's very easy to use and perform pretty well, with the added benefit that can also be used to generate Excel files from web applications without the need to install Excel on the server and without the problems of using Excel on servers.
If you are using just client application directly interacting with Excel using the Primary Interop Assemblies is easy, but you need Excel to be installed on client machines.

massimogentilini
A: 

Aspose.cells met my requirments every time. Its not open source but the support is great. If you need a function they will either implement it or give you a straight answer. Excel 2007 is fully supported.

Tom Pester
+7  A: 

I've tried a couple, and summarised my thoughts in a blog post. XlsIO is mostly OK, but can be pretty frustrating at times. SpreadsheetGear is probably the nicest, and the fastest, but also the most expensive.

Samuel Jack
+3  A: 

I really like FlexCel from TMS Software. One of its best features is the huge volume of sample applications that ship with it. It even has a tool that will take an existing spreadsheet and show you the exact code needed to create it. I have used it successfully, and it also does not require Excel to be installed on the target machine. This makes it great for servers.

FlexCel from TMS Software

Pittsburgh DBA
Me and my colleagues don't like FlexCel api. Sometimes the API design is awful. Speed is sometimes 10 times slower than using COM Automation. :(
nightcoder
+4  A: 

I often found that when a client want the app to be "excel-enabled" he often just want to see a little excel button in a table/chart that will bring the data for him in "excel" without the tedious cut&paste procedure :P

Sending the same HTML table back to the browser with a content-type of vnd-excel do the trick. Server returns plain HTML tagged as EXCEL document. OS fires up EXCEL with that document. Excel interpret the HTML and transform it into the spreadsheet you are looking for... Of course it doesn't work if you want to have any of excel's many objects (graph, pivot, formula, filter for example) but still it could be useful.

Here is an example of how-to do it in classic-asp:

Response.ContentType = "application/vnd.ms-excel"
matdumsa
good point -for simple export data as a table solutions, this works well.
Anonymous Type
+2  A: 

Give Spreadsheet Gear a try. It can read and write formulas and macros of a spreadsheet. No Excel is required for execution. The website has some good samples on it. The API is well documented and we had an app completed within a few days. It's a very nice tool and worth the $$.

David Robbins
+1  A: 

SmartXLS is also a good choice.It support most features of excel like Charts,formulas, and the excel2007 format. SmartXLS for .net(java)

liya
A: 

I think Gembox.Spreadsheet is very good component to read and write Excel spreadsheets in variety of formats (XLS, XLSX, ODS, CSV, HTML). It is also very fast and easy to use. They provided huge number of examples.

A: 

I would definitely stay away from using Excel Automation / Object library if you can. I used it in a small application hosting maybe 10 concurrent users at a time for over 2 years and constantly had annoying setup issues on the servers, working with the DComConfig, installing office on my production servers, and weird issues that would need me to restart the server periodically. That and its very slow. So far SpreadSheet gear definitely seems to be the best solution for a robust and efficient well documented solution. But it does cost $1000. Another easy way is to use the OpenXML library, create template of what you want, and just modify the data with that library.

JTtheGeek
actually using Excel API's serverside is an unsupported solution, for the reasons you mention. Excel API's are designed to be clientside only.working with XLSX and a XML library is one way, using ADO.NET is another.
Anonymous Type
+1  A: 

I've used with success the following open source projects:

  • ExcelPackage for OOXML formats (Office 2007)

  • NPOI for .XLS format (Office 2003)

Take a look at these links for more info:

Create Excel (.XLS and .XLSX) file from C#

Creating Excel spreadsheets .XLS and .XLSX in C#

NPOI with Excel Table and dynamic Chart

Leniel Macaferi
A: 

I have tried many solutions and my favorite is Clear Office.

I would stay away from Office COM interop. It is really slow and tends to crash.

XlsIo is very basic. SpreadsheetGear is fine.

I like Clear Office because they have the entire spreadsheet, not just bits and pieces. It is also very fast and the object model is clean. As for the price, most solutions are quite affordable. Once you pay one developer license, you can install it on as many desktops as you want.