将GridView数据导出到Excel. [英] Export GridView data to Excel.

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

问题描述

大家好,

我有麻烦了.

谁能告诉我如何将Gridview数据导出到Excel文件中.
请发送我尝试过的特定代码,但它显示错误信息,例如

Hello to all,

I am in trouble.

Can any one tell me how I export my Gridview data into Excel File.
Please send a specific Code I tried but it shows error like

Error	1	

The type or namespace name ''ExcInterop'' does not exist in the namespace ''Microsoft'' (are you missing an assembly reference?)


然后我使用命名空间


and then I use Namespace

using Excel = Microsoft.Office.Interop.Excel;

它显示错误.我应该怎么知道我也安装了DLL reg,但是它不起作用...

谢谢&问候
莫希特

[edit]主题,标签,大写字母,代码块,次要英语,紧急程度已删除.这可能对您很紧急,但对我们而言并非如此.您所强调的紧迫性只是使我们认为您离开得太晚了,并希望我们为您做这件事.这使某些人烦恼,并且可能会减慢响应速度-OriginalGriff [/edit]
[edit2] ...然后我取消了忽略HTML ..."选项.我必须检查预览.我必须检查预览.我必须检查预览...-OriginalGriff [/edit2]

It shows error. What should I do know I also install DLL reg but its not working...

Thanks & Regards
Mohit

[edit]Subject, Tags, Capitalization, code blocks, minor English, urgency removed. It may be urgent to you, but it isn''t to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response - OriginalGriff[/edit]
[edit2]...And then I disanbled "Ignore HTML..." option. I must check the preview. I must check the preview. I must check the preview... - OriginalGriff[/edit2]

推荐答案

使用程序集引用

请在遇到问题时发送特定的代码.
using assembly reference

please send a specific Code in you problem.


看看那里-CPArticle [ ^ ]了解如何


Google是一个了不起的工具:使用新主题对您的问题将GridView数据导出到Excel"进行快速搜索,结果获得了1,490,000次点击.包括此在内,就在顶部:将GridView导出到Excel完整代码! [ ^ ]

搜索的整个首页是使用完整源代码实现搜索的不同方法...

使用谷歌.它可以节省您大量的时间和精力.
Google is an amazing tool: a quick search using the new subject for your question "Export GridView data to Excel" gave 1,490,000 hits. Including this one, right at the top: Export GridView to Excel Complete Code![^]

The whole first page of the search was different ways to achieve it with full source code...

Use Google. It can save you a lot of time and effort.


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

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