简体   繁体   English

在C#UWP Windows 10 App中读取和写入Excel工作表

[英]Reading and Writing to Excel sheet in C# UWP Windows 10 App

I am working on a project for Windows 10 UWP App. 我正在为Windows 10 UWP App开发一个项目。 I have below two problems 我有两个问题

1. I have to upload excel sheet containing the data, and store that data into Sq-lite Database. 1. 我必须上传包含数据的excel表,并将该数据存储到Sq-lite数据库中。

2. Also I have to read data from database table, and write to excel sheet in rows and column format. 2. 此外,我必须从数据库表中读取数据,并以行和列格式写入Excel工作表。

I have searched a lot but could not find any library or helping blog . 我搜索了很多,但找不到任何图书馆或帮助博客 I would be thankful for any complete guide or sample code. 我会感谢任何完整的指南或示例代码。 Thanks!! 谢谢!!

I would suggest you use Syncfusion Essential XlsIO . 我建议你使用Syncfusion Essential XlsIO It does the work for your read/write of excel files (also works with Xamarin and ASP.Net). 它可以帮助您读取/写入excel文件(也适用于Xamarin和ASP.Net)。 It has a 30-day free trial but you can get a free community license. 它有30天的免费试用期,但您可以获得免费的社区许可。

Just so you know, thx to .Net Standard 2.0 we are able to use the OpenXML SDK! 您知道,对于.Net Standard 2.0,我们可以使用OpenXML SDK! This allows you to create and/or manipulate MS Office documents. 这允许您创建和/或操作MS Office文档。

As an example I've blogged about creating Excel files on the fly in Xamarin Forms ( that also can generate an UWP app ) here http://depblog.weblogs.us/2017/10/13/net-standard-2-0-create-microsoft-office-documents-in-xamarin-forms/ 作为一个例子,我在博客中写了关于在Xamarin Forms中动态创建Excel文件(也可以生成UWP应用程序) http://depblog.weblogs.us/2017/10/13/net-standard-2-0 -create微软办公的文档功能于xamarin表单/

The SDK itself is open source https://github.com/OfficeDev/Open-XML-SDK and there is a very large detailed documentation site available too https://msdn.microsoft.com/en-us/library/office/bb448854.aspx SDK本身是开源的https://github.com/OfficeDev/Open-XML-SDK ,还有一个非常大的详细文档站点也可用https://msdn.microsoft.com/en-us/library/office/ bb448854.aspx

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

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