简体   繁体   English

在WinRT平台中使用C#导入电子表格并处理数据

[英]Importing spreadsheet using C# in WinRT platform and manipulating the data

I am developing an application which primarily imports spreadsheet reads the data and manipulates it. 我正在开发一个主要导入电子表格的应用程序,用于读取数据并进行操作。 I was googling all day, unable to find a way to read data from excel files. 我整日都在搜索,无法找到一种从excel文件读取数据的方法。 It would be great if I could get some help to do the required. 如果我可以得到一些帮助来完成所需的操作,那将是非常不错的。

Information : I am developing Windows Store app using C#/XAML. 信息:我正在使用C#/ XAML开发Windows应用商店应用。

Reference libs/apps which read excel : 引用excel的libs / apps:

http://www.componentone.com/SuperProducts/SpreadNET/ http://www.componentone.com/SuperProducts/SpreadNET/

http://www.greatwindowsapps.com/app/tile-charts http://www.greatwindowsapps.com/app/tile-charts

If you look for a free open source solution, I used in several projects exceldatareader from codeplex lib, very simple and easy to use. 如果您正在寻找免费的开源解决方案,那么我在codeplex lib的多个项目中使用过exceldatareader ,它非常简单易用。

It depends only by SharpZipLib, I think that you have only to recompile both projects as portable libs to make it work on WinRT. 它仅取决于SharpZipLib,我认为您只需要将两个项目重新编译为可移植库即可使其在WinRT上运行。

If you're working with .xlsx files there's always Open XML SDK which you can get from NuGet as well. 如果您使用的是.xlsx文件,那么始终可以从NuGet中获得 Open XML SDK Here 'sa bunch of tutorials to get you started. 这里有很多教程可以帮助您入门。 Unfortunately the really nice wrapper library ClosedXML doesn't work with Windows Store apps. 不幸的是,非常好的包装库ClosedXML不适用于Windows Store应用程序。

There's also a commercial component available, XlsIO from Syncfusion , which you could try out. 还有一个商用组件Syncfusion的XlsIO ,您可以尝试一下。 I don't have any first hand experience with it. 我没有任何亲身经历。

I posted the same the question in the MSDN Blog 我在MSDN博客中发布了相同的问题

http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/4fce4765-2d05-4a2b-8d0a-6219e87f3307 http://social.msdn.microsoft.com/Forums/zh-CN/winappswithcsharp/thread/4fce4765-2d05-4a2b-8d0a-6219e87f3307

Code provided by VT.CrazyAppy works fine for reading & parsing simple spread sheet file. VT.CrazyAppy提供的代码可以很好地读取和解析简单的电子表格文件。 The code snippet is static , I am working on it to make it more generic.will post the code once I done with that. 该代码段是静态的,我正在努力使其更加通用。完成后将发布代码。

Note : The code will provide a mechanism to read a simple spread sheet file and return them as K,V pair. 注意:该代码将提供一种读取简单的电子表格文件并将其作为K,V对返回的机制。 You can modify it to suit your need. 您可以对其进行修改以适合您的需要。

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

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