将数据网格导出到Excel [英] Export datagrids to Excel

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

问题描述

我有一个用asp.net编写的网页,上面有多个数据网格,需要将
导出到Excel。每个数据网格都是上面数据网格的一个子集。


到目前为止,我找不到任何东西都没有运气工作可靠。我已保存的文件(使用单选按钮点击事件)中的一些

将在

Excel中正常打开,其他人给我一个无法打开文件 ;消息。


任何帮助表示赞赏。


谢谢,


SC


解决方案

对于简单页面,您可以将页面导出为Excel,因为表格将呈现。

更多复杂的Excel,您要么必须针对Excel

对象进行编程(在Web服务器上设置Office组件),这非常非常昂贵,性能优异,或者获得第三方组件。我的建议是

在componentsource.com等网站上找到第三方组件。


-

Gregory A Beamer

MVP; MCP:+ I,SE,SD,DBA


**************************** ********************** ********************

在盒子外面思考!

************************************* ************* ********************

< me@privacy.net>在消息中写道

news:uT ************** @ TK2MSFTNGP09.phx.gbl ...

我有一个网页用asp.net写的,它上面有多个datagrids
需要导出到Excel。每个数据网格都是上面数据网格的
子集。

到目前为止,我没有找到任何可靠工作的运气。我保存的一些文件(使用单选按钮点击事件)将在Excel中打开正常,其他人则给我一个无法打开文件。任何帮助表示感谢。

谢谢,

SC



我发现以下在线文章和样本很有用。查看

http ://www.c-sharpcorner.com/Code/20...GridToExcel.as


Suresh


- ---- me@privacy.net 写道:----


我有一个网页用asp.net写的,上面有多个数据网格,需要将
导出到Excel。每个数据网格都是它上面的数据网格的一个小部分


到目前为止,我没有找到任何工作的运气可靠。我保存的文件(使用单选按钮点击事件)会有一些好处。我会打开罚款我好吗?
Excel,其他人给我一个无法打开文件 ;消息


感谢任何帮助


谢谢


S


我已经尝试过这个版本的VB版本,最后得到一个空白页面,其中没有任何内容。

SC

" Suresh" <一个******* @ discussions.microsoft.com>在消息中写道

新闻:8C ********************************** @ microsof t.com ...

我发现以下在线文章和示例很有用。检查
out。
http://www.c-sharpcorner.com/Code/20...ridToExcel.asp
Suresh。

----- me@privacy.net 写道:-----

我有一个用asp.net编写的网页,在$ b $上有多个数据网格b它需要导出到Excel。每个数据网格都是上面数据网格的
子集。

到目前为止,我没有找到任何可靠工作的运气。
我保存的一些文件(使用单选按钮点击事件)将在Excel中打开
罚款,其他人则给我一个无法打开文件任何帮助表示感谢。

谢谢,

SC



I have a web page written in asp.net that has multiple datagrids on it that
would need to be exported to Excel. Each of the datagrids would be a subset
of what the datagrid above it was.

Thus far, I''ve had no luck in finding anything to work reliably. Some of
the files I''ve saved (using a radio button click event), will open fine in
Excel, others give me an "Unable to open file" message.

Any help appreciated.

Thanks,

SC


解决方案

For simple pages, you can export the page as Excel as tables will render.
For more complex Excel, you will either have to program against the Excel
objects (set up Office components on the web server), which is awfully
expensive, perf wise, or get a third party component. My suggestion would be
to find a third party component on a site like componentsource.com.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
<me@privacy.net> wrote in message
news:uT**************@TK2MSFTNGP09.phx.gbl...

I have a web page written in asp.net that has multiple datagrids on it that would need to be exported to Excel. Each of the datagrids would be a subset of what the datagrid above it was.

Thus far, I''ve had no luck in finding anything to work reliably. Some of
the files I''ve saved (using a radio button click event), will open fine in
Excel, others give me an "Unable to open file" message.

Any help appreciated.

Thanks,

SC



I found the following online article and sample to be useful. Check it out

http://www.c-sharpcorner.com/Code/20...GridToExcel.as

Suresh

----- me@privacy.net wrote: ----

I have a web page written in asp.net that has multiple datagrids on it tha
would need to be exported to Excel. Each of the datagrids would be a subse
of what the datagrid above it was

Thus far, I''ve had no luck in finding anything to work reliably. Some o
the files I''ve saved (using a radio button click event), will open fine i
Excel, others give me an "Unable to open file" message

Any help appreciated

Thanks

S


I''ve tried a VB version of this and just end up with a blank page with
nothing in it.
SC
"Suresh" <an*******@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...

I found the following online article and sample to be useful. Check it out.
http://www.c-sharpcorner.com/Code/20...ridToExcel.asp
Suresh.

----- me@privacy.net wrote: -----

I have a web page written in asp.net that has multiple datagrids on it that would need to be exported to Excel. Each of the datagrids would be a subset of what the datagrid above it was.

Thus far, I''ve had no luck in finding anything to work reliably. Some of the files I''ve saved (using a radio button click event), will open fine in Excel, others give me an "Unable to open file" message.

Any help appreciated.

Thanks,

SC



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

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