导出到Excel [英] Export To Excel

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

问题描述

如果控件

不是服务器端,有没有办法将数据从控件导出到excel?我是否必须使用java脚本执行此操作,还是可以在我的VB.NET代码中执行



解决方案

"杜奇" < dn ****** @ dtgnet.com写信息

news:11 ********************** @ q2g2000cwa .googlegro ups.com ...


如果控件

不是服务器,有没有办法将数据从控件导出到excel侧?



很难说不知道它是什么控件...你说它不是一个

服务器端控件,所以它是一个ActiveX控件还是一个Java小程序......?


我是否必须使用java脚本或者我可以在VB.NET代码中执行此操作?



见上文。



很难说没有知道它是什么控件...你说它不是一个服务器端控件,所以它是一个ActiveX控件还是一个Java applet ......?



这是一个内置于页面HTML内的控件,但它没有

runat =" server"标签在里面。所以我没有办法在

VB.NET中访问它。


我是一个相对较新的ASP.NET(一些培训) )所以我不确定

抓住这个控件及其数据的最佳方法。


以下是第一部分的示例控件的代码看起来像HTML中的
。我没有任何办法可以抓住这个

" DataTable"控制(及其数据)在VB.NET中:


< table id =" DataTable" DATASRC = QUOT;#ReportResult" cellSpacing =" 0"

cellPadding =" 1" border =" 1">

< THEAD>

< TR>

< td class =" COLHDR2" onclick =" SortFields(''@ SomeDBParameter'')"

width =" 65" SomeDBValue< / td>

< td class =" ; COLHDR2" width =" 70"

onclick =" SortFields(''@ AnotherDBParameter'')"> anothe rDBValue< / td>


"杜奇" < dn ****** @ dtgnet.com写信息

新闻:11 ********************** @ j27g2000cwj .googlegr oups.com ...


>很难说不知道它是什么控制...你说的'它不是服务器端控件,所以它是ActiveX控件还是Java applet ......?



它是一个内置于页面HTML内的控件,但它没有

runat =" server"标签在里面。



那么它是什么,然后...... ????它从何而来?是什么构建的?

从哪里获取数据......?


< table id =" DataTable" DATASRC = QUOT;#ReportResult" cellSpacing =" 0"

cellPadding =" 1" border =" 1">

< THEAD>

< TR>

< td class =" COLHDR2" onclick =" SortFields(''@ SomeDBParameter'')"

width =" 65" SomeDBValue< / td>

< td class =" ; COLHDR2" width =" 70"

onclick =" SortFields(''@ AnotherDBParameter'')">另一个rDBValue< / td>



哇!自从我见过这样的事情已经有一段时间了!这甚至是

ASP.NET ......?
http://msdn.microsoft.com/library/de...es/datasrc.asp


好​​的,那么填充表格的dataSrc属性是什么......?


Is there a way to export data from a control into excel if the control
is not server side? Do I have to do it with java script or can I do
it inside my VB.NET code?

解决方案

"Doogie" <dn******@dtgnet.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...

Is there a way to export data from a control into excel if the control
is not server side?

Difficult to say without knowing what control it is... You say it''s not a
server-side control, so is it an ActiveX control or a Java applet...?

Do I have to do it with java script or can I do it inside my VB.NET code?

See above.


Difficult to say without knowing what control it is... You say it''s not a
server-side control, so is it an ActiveX control or a Java applet...?

It''s a control built inside the HTML of the page but it does not have
the runat="server" tag in it. So I don''t have a way to access it in
VB.NET.

I''m relatively new to ASP.NET (some training) so am not real sure the
best approach at grabbing this control and it''s data.

Here is a sample of what the first part of the control''s code looks
like in the HTML. I don''t have any way that I can see to grab this
"DataTable" control (and it''s data) inside VB.NET:

<table id="DataTable" dataSrc="#ReportResult" cellSpacing="0"
cellPadding="1" border="1">
<THEAD>
<TR>
<td class="COLHDR2" onclick="SortFields(''@SomeDBParameter'')"
width="65">SomeDBValue</td>
<td class="COLHDR2" width="70"
onclick="SortFields(''@AnotherDBParameter'')">Anothe rDBValue</td>


"Doogie" <dn******@dtgnet.comwrote in message
news:11**********************@j27g2000cwj.googlegr oups.com...

>Difficult to say without knowing what control it is... You say it''s not a
server-side control, so is it an ActiveX control or a Java applet...?


It''s a control built inside the HTML of the page but it does not have
the runat="server" tag in it.

So what is it, then...???? Where does it come from? What builds it? Where
does it get its data from...?

<table id="DataTable" dataSrc="#ReportResult" cellSpacing="0"
cellPadding="1" border="1">
<THEAD>
<TR>
<td class="COLHDR2" onclick="SortFields(''@SomeDBParameter'')"
width="65">SomeDBValue</td>
<td class="COLHDR2" width="70"
onclick="SortFields(''@AnotherDBParameter'')">Anothe rDBValue</td>

Wow! It''s been a while since I''ve seen anything like that! Is this even
ASP.NET...?
http://msdn.microsoft.com/library/de...es/datasrc.asp

OK, so what is populating the table''s dataSrc property...?


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

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