OPEN XML导出2007/2010 [英] OPEN XML to Export 2007/2010

查看:95
本文介绍了OPEN XML导出2007/2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我已经具有导出为2003格式的功能.在我从模板构造字符串并使用System.IO.File.WriteAllText编写的地方.

In my application I already have functionality to export into 2003 format. Where I am constructing a string out of the template and write using System.IO.File.WriteAllText.

但是它不适用于excel 2007/2010,这就是为什么我想将其转换为Openxml以支持2007和2010的原因.

But it does not work with excel 2007/2010, that's why I wanted to convert it to Openxml in order to support 2007 and 2010.

我已经准备好从模板创建单元格和行的字符串.

I have string ready with creation of cells and rows from template.

我想要有关如何实现的建议,或者任何机构都有参考链接.

I want advice on how to achieve or any body has reference link.

请让我知道.

致谢

推荐答案

WriteAllText类将为您保存一个文本文件.您正在保存带有xls扩展名的基于html(文本)的文件.这不是真正的xls文件(实际上是二进制文件),但是MS Excel可以识别并解释html格式.

WriteAllText class will save you a text file. You are saving an html(text) based file with xls extension. This is not a real xls file (that is actually a binary file), but MS Excel recognize and interpret the html format.

xlsx文件是二进制文件.您可以使用OpenXML Office库(Excel.XlFileFormat.xlOpenXMLWorkbook)或其他.NET Excel库,例如 EasyXLS .有关更多信息,请查看此示例代码详细信息.

An xlsx file is a binary file. You can use OpenXML Office library ( Excel.XlFileFormat.xlOpenXMLWorkbook ) or another .NET Excel library like EasyXLS. Check this sample of code for more details.

这篇关于OPEN XML导出2007/2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆