How to create ODS documents in .Net

家住魔仙堡 提交于 2020-01-05 04:40:10

问题


I'm going to convert an existing C# project, which writes an Excelfile with multiple tabs, to write ODS documents instead. I can open the existing Excel files in Open Office and convert them there, but this isn't a good solution in the long run.

Anybody know of any existing (preferably free/open source) API's that let you do this? Or if not, a not too complex How-To?


回答1:


Open Office is open source and has some section of its code that turns an internal representation into an ODS file. That is not only the definitive API, it is likely the only one. Whether or not it is easy to use or well documented is another question. I'm currently downloading the 1.2GB of source and may have a more complete answer in a bit.

update:

With 146k files spread over 15k directories, not including the 70 major third-party libraries included only by reference, I'm not even going to try to wrap my head around it. Fortunately, the developer's documentation looks better than I would have expected. Do note that OO has to be able to read Microsoft XLS files and their bastard OfficeXML files so there is already much code in there that does half or more of your work for you.

You have a good piece of work ahead of you. On the other hand, done well, your code could be quite valuable to the world as a whole. Since you will be deriving your work from open source, I strongly suggest you get managerial approval to pass your work back to the OO team, as they would be able to make best use of it. Since the OO source is covered by the LGPL it is not required that you make your work available (unless you publish / distribute your derivative) it would still be a Good Thing to do.



来源:https://stackoverflow.com/questions/3117395/how-to-create-ods-documents-in-net

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