将数据从gridview保存到Word文件 [英] saving data from gridview to word file

查看:78
本文介绍了将数据从gridview保存到Word文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
现在,我有一个包含一些电话号码和用户名的gridview,我想创建一个按钮以将该数据保存到用户pc中的word文件中.请问我该怎么做?
谢谢

Hi All,
Now i have a gridview that contains some of phone numbers and user name and i want to make a button to save that data into word file in the pc of user. How can i make this, please?
Thanks

推荐答案

如果Office 2007版本还可​​以,请使用 ^ ]可能是最有趣的方法.

基本上,按照您希望的样子创建Word文档,然后创建将生成该文档的类,循环遍历数据结果并将值放在文档中的适当位置.


并非易事,但值得付出努力,尤其是如果您想从Web服务器中吐出结果时……这几乎无法使用任何形式的Office自动化".
If an Office 2007 version is okay, then using the Open XML Tool[^] is probably the most fun way to do it.

Basically, create the Word doc as you would like it to appear, then create the class that will generate it, looping through your data result and put the values in the appropriate place in the doc.


Not easy, but well worth the effort, especially if you want to spit out the result from a web server...which pretty much precludes using any sort of Office "automation".


您好,

只是谷歌搜索导出gridview到word"作为关键字.我得到了254K的结果.如果您注意到CP的第三个结果,则URL下面是第二个.

Export-GridView-Word- Excel-PDF-CSV-Formats-in-ASP.Net [
Hi,

Just am googled with ''export gridview to word'' as keyword. I got 254K results. below URL is Second one, if you noticed Third result from CP.

Export-GridView-To-Word-Excel-PDF-CSV-Formats-in-ASP.Net[^]

My suggestion is: Please search it before asking the question.


这篇关于将数据从gridview保存到Word文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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