You need to add this in your code and i hope you will get your solution.
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=Download History(" + Date.Now + ").xls")
Response.Charset = ""
Me.EnableViewState = False
Response.ContentType = "application/vnd.ms-excel"
Dim sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
'Add all data in Repeater.
Repeater1.RenderControl(hw)
Response.Output.Write(sw.ToString())
Response.Flush()
Response.[End]()
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=Download History(" + Date.Now + ").xls")
Response.Charset = ""
Me.EnableViewState = False
Response.ContentType = "application/vnd.ms-excel"
Dim sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
'Add all data in Repeater.
Repeater1.RenderControl(hw)
Response.Output.Write(sw.ToString())
Response.Flush()
Response.[End]()
No comments:
Post a Comment