将excel文件从GridView保存到本地计算机ASP.NET VB [英] Save excel file from GridView to local computer ASP.NET VB

查看:103
本文介绍了将excel文件从GridView保存到本地计算机ASP.NET VB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想将Excel文件保存到特定路径,但是在客户端计算机中,而不是在服务器中。有可能吗?





Hi
I want to save Excel file to specific path, but in client computer, not in server. It is possible?


Response.Clear()
			Response.Buffer = True
			Response.AddHeader("content-disposition", "attachment;  filename=test.xls")
			Response.ContentEncoding = System.Text.Encoding.default
			Response.Charset = ""
			Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
			dim sWriter As New StringWriter()
			Dim hWriter As New HtmlTextWriter(sWriter)
			GridView1.AllowPaging = False
GridView1.RenderControl(hWriter)
			Response.Output.Write(sWriter.ToString())
			Response.Flush()
			Response.End()

推荐答案

尝试这个论坛,这可能帮助你,export-excel-data-to-datagrid-using-openfiledialog / [ ^ ]



或者这个。 [ ^ ]



我认为你应该指定一个路径文件,以便它保存在客户端电脑上。
TRY THIS FORUM , THIS MIGHT HELP YOU, export-excel-data-to-datagrid-using-openfiledialog/[^]

OR THIS. [^]

And i think you should specify a pathfile so that it saves on client pc.


这篇关于将excel文件从GridView保存到本地计算机ASP.NET VB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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