V
Vincent
Hi, I use the following code to export to Excel, which works fine.
GVAPInv.AllowSorting = "False"
Gridvew1.DataBind()
Gridvew1.AllowSorting = "False"
Gridvew1.DataBind()
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim frm As HtmlForm = New HtmlForm()
Me.Controls.Add(frm)
frm.Controls.Add(Gridvew1)
frm.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
Gridvew1.AllowSorting = "False"
Gridvew1.DataBind()
I'm having trouble figuring out how to export to a simple Csv file.
I've tried to change the response.contenttype to:
Response.ContentType = "text/csv"
This only generates html code (pasted sample below). Any help would be
appreciated. Thank you.
GVAPInv.AllowSorting = "False"
Gridvew1.DataBind()
Gridvew1.AllowSorting = "False"
Gridvew1.DataBind()
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim frm As HtmlForm = New HtmlForm()
Me.Controls.Add(frm)
frm.Controls.Add(Gridvew1)
frm.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
Gridvew1.AllowSorting = "False"
Gridvew1.DataBind()
I'm having trouble figuring out how to export to a simple Csv file.
I've tried to change the response.contenttype to:
Response.ContentType = "text/csv"
This only generates html code (pasted sample below). Any help would be
appreciated. Thank you.