How can I create an Excel compatible Spreadsheets

2020-02-09 14:49发布

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

10条回答
beautiful°
2楼-- · 2020-02-09 15:21
神经病院院长
3楼-- · 2020-02-09 15:26

Checkout my post 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.

查看更多
Bombasti
4楼-- · 2020-02-09 15:34

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

查看更多
家丑人穷心不美
5楼-- · 2020-02-09 15:35

We have found SpreadsheetLight to be both excellent and open source.

查看更多
再贱就再见
6楼-- · 2020-02-09 15:36

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.

查看更多
ゆ 、 Hurt°
7楼-- · 2020-02-09 15:37

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

查看更多
登录 后发表回答