问题
I am developing an app using Mono for Android. I need capabilities to read and create XLSX (Excel) files. I have tried with EPPlus and NPOI, and had a quick look at Microsoft's Open XML SDK and found the following problems:
- EPPlus requires the WindowsBase assembly which, AFAIK, i can't use this assembly in Mono
- NPOI requires System.Drawing, which doesn't seem to work in Mono
- Open XML SDK requires the WindowsBase assembly.
So i am running out of ideas, is there any library that i can run under Mono that supports XLSX? 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:
I created a fork of NPOI without references to System.Windows.Forms, System.Drawing and System.Configuration making it suitable for use with Xamarin. So far it's working well with the Xamarin.Mac unified API.
Note that this is achieved by removing capabilities rather than replacing them, but most core functionality should be unaffected.
回答2:
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.
Component
回答3:
Try this port of OpenXmlSdk to Xamarin https://github.com/wotzisname/open-xml-sdk-xamarin
来源:https://stackoverflow.com/questions/19102998/mono-for-android-reading-and-writing-to-xlsx