Reading Openoffice Calc (.ods) programmatically us

2019-06-18 22:53发布

I want to know if it is possible to read OpenOffice Calc spreadsheet programatically with c#, I can do this for Excel(.xls and .xlsx) but unable to find a solution for reading calc spreadsheet.

Help me if anyone has solution.

3条回答
来,给爷笑一个
2楼-- · 2019-06-18 23:28

You should have a look at the GemBox.Spreadsheet component from GemBox that supports XLSX, XLS, CSV, ODS or HTML file format.

There's both a free and a paid version of it.

查看更多
太酷不给撩
3楼-- · 2019-06-18 23:46

ODF .NET - It works for c# and you can read and write.

Says like this on there page:

ODF .NET allows you to write applications to create, modify and parse text documents and spreadsheets. Supports all versions of .NET Framework, .NET Compact Framework and Mono.

查看更多
你好瞎i
4楼-- · 2019-06-18 23:46

If you want to work directly against a headless OpenOffice/LibreOffice instance to manipulate the spread sheets, you are going to need to use OpenOffice/LibreOffice component interface UNO. This is a bit of a pain because of the casts that are required in strongly typed languages (UNO has bindings for many languages), deny you of the tooling you would expect unless you find a C# OpenOffice set of wrapper classes. There are other frameworks to manipulate the document but to work with it via OpenOffice directly this is the only way.

Here is some example code of someone creating an xls spread sheet with c#: Use OpenOffice Uno CLI with C# to create a spreadsheet

Here is the OpenOffice UNO reference: http://www.openoffice.org/api/docs/java/ref/overview-summary.html

查看更多
登录 后发表回答