I have Grid view which contains template fields like drop down list and text box
When i export grid view to excel 2010
The excel to which i exported grid view also contains drop down and text boxes which are in grid view.
Which i do not want.I just want value selected in drop down to be exported to excel sheet not entire drop down
My code is below for exporting
When i export grid view to excel 2010
The excel to which i exported grid view also contains drop down and text boxes which are in grid view.
Which i do not want.I just want value selected in drop down to be exported to excel sheet not entire drop down
My code is below for exporting
Code:
Try
'EXPORTING REPORT TO APPROVER GRID EXCEL.
Response.ClearContent()
Response.Buffer = True
Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", "Salary_Revision_Approver.xls"))
Response.ContentType = "application/ms-excel"
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)
gvsrapprogrid.AllowPaging = False
gvsrapprogrid.Columns(13).Visible = False
gvsrapprogrid.HeaderRow.Style.Add("background-color", "#FFFFFF")
For i As Integer = 0 To gvsrapprogrid.HeaderRow.Cells.Count - 1
gvsrapprogrid.HeaderRow.Cells(i).Style.Add("background-color", "#df5015")
Next
gvsrapprogrid.RenderControl(htw)
Response.Write(sw.ToString())
Catch ex As Exception
Page.ClientScript.RegisterStartupScript(Page.GetType(), "alertmesg", "<script language=javascript> alert('DATA NOT AVAILABLE TO BE VIEWED');</script>")
End Try
Response.End()
Comment