views:

608

answers:

9

I'd like to make server-side excel compatible spreadsheets that maybe use OpenXML or a structured data format.

I've used Office Interop before to generate Excel spreadsheets, but those apps run on a PC that has office installed.

For this web project I'm building, the server doesn't have office installed (and they don't want to buy it).

What's the best library for me to use that allows me to generate office compatible spreadsheets from a windows server 2k8 using IIS7?

Some additional requirements

  • Ideally, free
  • Allows for simple cell formulas that can be inserted at runtime
+2  A: 

You can try this library.

Or the Spreadsheetgear generator.

astander
+2  A: 

Microsoft published the OpenXML SDK.

Alternatively download the OpenXML schemas, generate simple examples with Office and use them as a foundation to write your own XML files - its not that complicated.

Georg Fritzsche
+1  A: 

You could use the NPOI library.

Free, Open source and supports reading and writing Excel, Word and Powerpoint documents

Simon P Stevens
+1  A: 

Take a look at the Simple OOXML open source library.

Magnus Johansson
+1  A: 

I've used SmartXLS to create (and process) Excel sheets on the server.

edosoft
+4  A: 

try ExcelPackage at codeplex. its simple and efficient.

TheVillageIdiot
+1  A: 

You can simply save your data into a comma separated values (CSV) file with .xls extension.

Example:

column1,column2,column3

value11,value12,value13

value21,value22,value23

value31,value32,value33

value41,value42,value43

value51,value52,value53

lg
+2  A: 

A very simple solution is:

You can build the content of the spreadsheet as a html table. Return the table to the browser with the appropriate headers set.

Response.ContentType = "application/vnd.ms-excel"

You can even add excel formulas and do simple formatting.

Henrik Jepsen
A: 

Checkout my post http://stackoverflow.com/questions/1273116/reading-excel-files-as-a-server-process for a list of some paid ones.

The one I opted for named FlexCel was very easy to use, allowed formulae to be used at run-time, was fully managed and low cost/royalty free.

Ian