[英]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.