简体   繁体   English

我们如何为Windows Phone 8创建,写入和读取Excel文件

[英]How can we create, write and read an excel file for Windows Phone 8

I have created the file and written some data on it. 我已经创建了文件并在上面写了一些数据。 When I look for created file in windows explorer it is not present. 当我在Windows资源管理器中查找创建的文件时,它不存在。 On the other side am not able to relate with the path of the file which I get on emulator. 另一方面,我无法与模拟器上的文件路径相关联。 This is the link am using. 这是链接正在使用。 Kindly help. 请帮助。

http://www.codeproject.com/Articles/33850/Generate-Excel-files-without-using-Microsoft-Excel?fid=1536838&df=90&mpp=10&noise=1&prof=True&sort=Position&view=Expanded&spc=None&fr=11#xx0xx http://www.codeproject.com/Articles/33850/Generate-Excel-files-without-using-Microsoft-Excel?fid=1536838&df=90&mpp=10&noise=1&prof=True&sort=Position&view=Expanded&spc=None&fr=11#xx0xx

WP8 supports opening up office in read-only mode with your files. WP8支持以只读模式打开文件的办公室。 In order to do that you'll need to activate Excel's app2app file extension. 为此,您需要激活Excel的app2app文件扩展名。 The excel office app is registered to the XLS and XLSX file extensions. excel office应用已注册到XLS和XLSX文件扩展名。

To send Office files you'll first need write the complete file into Isolated Storage. 要发送Office文件,您首先需要将完整的文件写入独立存储。 Once the file is in IsolatedStorage send it over to office by using Launcher.LaunchFileAsync() . 将文件放入IsolatedStorage之后,使用Launcher.LaunchFileAsync()将其发送到办公室。

    private async void LaunchExcel(object sender, RoutedEventArgs e)
    {
        var file = await ApplicationData.Current.LocalFolder.CreateFileAsync("myExcelFile.xlsx");
        using (var s = await file.OpenAsync(FileAccessMode.ReadWrite))
        using (var dw = new DataWriter(s))
        {
            dw.WriteString("hello world");
        }

        await Launcher.LaunchFileAsync(
            await ApplicationData.Current.LocalFolder.GetFileAsync("myExcelFile.xlsx"));
    }

I'm not sure if the XLS format the article you linked to is actually supported by office on WP8. 我不确定WP8上的办公室是否真的支持您链接到的文章的XLS格式。 If it's not consider using the ClosedXML OSS project to generate an XLSX office open XML @ http://closedxml.codeplex.com/ 如果不考虑使用ClosedXML OSS项目生成XLSX办公室,请打开XML @ http://closedxml.codeplex.com/

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

相关问题 我们如何以特定格式写入Windows Phone的现有excel文件的行和列? - How can we write into rows and columns of an existing excel file for windows phone in a particular format ??? Windows Phone 8和读/写文件 - Windows Phone 8 and read/write file 如何在项目浏览器中的“读取,写入”中访问文本文件,该文件不在Windows Phone 7的独立存储中? - How can I access a text file in the project explorer “read, write” which is not in the isolated storage in Windows Phone 7? 如何在c#windows phone 8.1应用程序中写入excel文件? - how to write into the excel file in c# windows phone 8.1 application? 无法写入Windows Phone中的文本文件 - Can't write to a text file in Windows Phone 如何在Windows Phone 8上使用Windows.Storage正确读写文件 - How to properly read and write a file using Windows.Storage on Windows Phone 8 我们可以在Windows Phone 8的XAML中编写或调用“ C代码”吗? - Can we write or call “C code” in XAML for Windows Phone 8 如何将数据写入Xml File Windows Phone? - How to write data in to Xml File Windows Phone? 如何在Windows Phone 8中将文本写入文件? - How to write text to a file in Windows Phone 8? 尝试在Windows Phone 8应用中写入然后读取XML文件时出错 - Error when trying to write then read a XML file in Windows Phone 8 app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM