Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Kindly help me on how to remove image in my excel header. I generate the excel using export command using gridview as source data. Here is my code
VB
Response.AddHeader("content-disposition", "attachment;filename=" & strFilename & ".xls")         
Response.Clear()         
Response.Charset = ""         
Response.ContentType = "application/vnd.xls"           
Dim sw As System.IO.StringWriter = New System.IO.StringWriter()         
Dim htw As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(sw)           
grvData.AllowPaging = False         
grvData.AllowSorting = False         
PopulateGrid()          
grvData.RenderControl(htw)         
Response.Write(sw.ToString)         
Response.End() 

Everything was set - except that one my header had a blank header name because of the image that was now shown - the image is came from gridview (I'm using arrow for asc and desc)
Posted
Updated 2-Sep-11 1:28am
v2

1 solution

Before Exporting hide your HeaderImage
use visible = false;
 
Share this answer
 
Comments
Philippe Mori 3-Sep-11 8:44am    
Exactly... much easier to export correctly than to correct it afterward.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900