java datagrid导出excel,将数据从Datagrid导出到Excel

hi,

I have a dataTable in Session.On the click of a button in a Modal Dialog window I need to export this dataTable to Excel sheet.How could i do this...??

i tried using a window.open(''Excel.aspx'','''','''','''') in the onclick of the button And wrote the code for export in the page load of Excel.aspx .But my session gets cleared.There are no datas in the dataTable.

i dont want to use query string...

Thanks in Advance,

Blacky

解决方案

hi,

I have a dataTable in Session.On the click of a button in a Modal Dialog window I need to export this dataTable to Excel sheet.How could i do this...??

i tried using a window.open(''Excel.aspx'','''','''','''') in the onclick of the button And wrote the code for export in the page load of Excel.aspx .But my session gets cleared.There are no datas in the dataTable.

i dont want to use query string...

Thanks in Advance,

Blacky

Look into where and why your Session is getting cleared.

I am doing about the same thing with a gridview and found the "dialogArguments" property to be useful as in:

Expand|Select|Wrap|Line Numbers

嗨,

我在Session中有一个dataTable。单击模态对话框窗口中的按钮,我需要将此dataTable导出到Excel工作表。我怎么能这样做... ??

i尝试使用window.open(''Excel.aspx'','''','''','''')点击按钮和在Excel.aspx的页面加载中编写了导出代码。但是我的会话被清除了。在dataTable中没有数据。

i不想使用查询字符串... < br />

在此先感谢,

Blacky

解决方案

hi,

>

我在Session中有一个dataTable。点击模态对话窗口中的按钮,我需要将这个dataTable导出到Excel工作表。我怎么能这样做...... ??

i尝试在按钮的onclick中使用window.open(''Excel.aspx'','''','''','''')并在Excel的页面加载中编写导出代码。 aspx。但是我的会话被清除了。有n o dataTable中的数据。

i不想使用查询字符串...

先谢谢,

Blacky

查看会话被清除的位置和原因。

我正在使用gridview做同样的事情并找到了" dialogArguments&QUOT;属性有用,如:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值