如何创建在.net ODS文件文件、net、ODS

2023-09-06 23:52:00 作者:诉情长

我要转换现有的C#项目,它写一个Excelfile有多个标签,写文件,消耗臭氧层物质替代。我可以打开开放式办公室现有的Excel文件并把它们转换有,但这不是长远来看一个很好的解决方案。

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.

有人知道任何现有的(preferably自由/开源)的API,让你这样做吗?如果还是不行,一个不太复杂的操作方法?

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?

推荐答案

开放式办公室的开源,并有其code的一些部分,轮流内部重新presentation到ODS文件。这不仅是明确的API时,它很可能是唯一的一个。不论它是易于使用或有据可查是另一个问题。目前,我正在下载源的1.2GB,并可以有一点更完整的答案。

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.

更新

使用146k文件小号$ P $垫了15K目录,不包括70个主要的第三方库仅作参考在内,我还没有去尝试环绕它我的头。幸运的是,开发者文档看起来比我的预期。请注意,OO必须能够读取微软XLS文件及其私生子OfficeXML文件,所以已经有很多code。在那里,你做一半或一半以上的工作。

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.

您有一个好的一块在你前面的工作。在另一方面,做得很好,你的code可能是相当有价值的整个世界。因为你会得出开源工作,我强烈建议你得到管理层的批准通过你的工作回到OO球队,因为他们将能够利用它充分利用。自二OO来源涵盖了LGPL 它不要求你做你的工作提供(除非你发布/分发您的衍生物)它仍然是一个很好的事情。

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.