如何将gridview导出到word [英] how to export gridview to word

查看:58
本文介绍了如何将gridview导出到word的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以将特定记录从gridview导出到word

can i export specific record from gridview to word

推荐答案

请参阅我对该问题的评论。不导出网格视图,导出用于填充此网格视图的数据。它将以多种方式帮助您,首先是代码维护。您已经拥有数据库所代表的数据层。使用您用于填充控件的相同查询从数据库生成文档。



要使用Word,您可以使用Office互操作程序集或Open XML DSK。请看我过去的答案。我把大部分链接都放在了这个答案中:

如何添加Microsoft Visual Studio 2010中的添加引用中的microsoft excel 15.0对象库 [ ^ ]。



-SA
Please see my comment to the question. Don't export grid view, export the data used to populate this grid view. It will help you in many ways, first of all, in code maintenance. You already have some data layer represented by your database. Generate the documents out of the database, using the same query you used to populate the controls.

To work with Word, you can use either Office interop assembly or Open XML DSK. Please see my past answers. I put most of the link to my answers in this one:
How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010[^].

—SA


你需要看看这个:

将选定的gridview行导出到Excel或ASP.Net中的单词 [ ^ ]
You need to have a look at this one:
Export selected rows of gridview to Excel or word in ASP.Net[^]


这篇关于如何将gridview导出到word的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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