简体   繁体   English

Mono for Android,读写XLSX

[英]Mono for Android, reading and writing to XLSX

I am developing an app using Mono for Android. 我正在使用Mono for Android开发应用程序。 I need capabilities to read and create XLSX (Excel) files. 我需要读取和创建XLSX(Excel)文件的功能。 I have tried with EPPlus and NPOI, and had a quick look at Microsoft's Open XML SDK and found the following problems: 我尝试过使用EPPlus和NPOI,并快速浏览一下Microsoft的Open XML SDK,发现了以下问题:

  1. EPPlus requires the WindowsBase assembly which, AFAIK, i can't use this assembly in Mono EPPlus需要WindowsBase程序集,AFAIK,我不能在Mono中使用这个程序集
  2. NPOI requires System.Drawing, which doesn't seem to work in Mono NPOI需要System.Drawing,它似乎不适用于Mono
  3. Open XML SDK requires the WindowsBase assembly. Open XML SDK需要WindowsBase程序集。

So i am running out of ideas, is there any library that i can run under Mono that supports XLSX? 所以我的想法已经不多了,有没有我可以在支持XLSX的Mono下运行的库? Is there any workaround to get these libraries working? 是否有任何解决方法可以使这些库工作?

The thing i need to be able to do is to 1. Insert images 2. Manipulate cell texts 我需要做的是1.插入图像2.操作单元格文本

I created a fork of NPOI without references to System.Windows.Forms, System.Drawing and System.Configuration making it suitable for use with Xamarin. 创建了一个NPOI的分支,但没有引用System.Windows.Forms,System.Drawing和System.Configuration,因此它适合与Xamarin一起使用。 So far it's working well with the Xamarin.Mac unified API. 到目前为止,它与Xamarin.Mac统一API一起运行良好。

Note that this is achieved by removing capabilities rather than replacing them, but most core functionality should be unaffected. 请注意,这是通过删除功能而不是替换它们来实现的,但大多数核心功能应该不受影响。

I put a link below to a component on the Xamarin component store that will allow you to edit / read / write XLSX or XLS files. 我在下面给Xamarin组件商店中的组件添加了一个链接,允许您编辑/读取/写入XLSX或XLS文件。

Component 零件

试试这个OpenXmlSdk端口到Xamarin https://github.com/wotzisname/open-xml-sdk-xamarin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM