Reading Openoffice Calc (.ods) programmatically using c#?

核能气质少年 提交于 2019-12-10 13:36:32

问题


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.


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/9989645/reading-openoffice-calc-ods-programmatically-using-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!