Author: pavankishan | Posted on: 5/7/2009 9:23:52 PM | Views : 327

Hi All,

 

i am working on a requirement where excel has to be generated on click of a button.

below is the code which will be executed on button click.

 strExcel contains the whole data in HTML layout

   Response.Clear()
            Response.AddHeader("content-disposition", "filename=Forecast.xls")
            Response.Charset = ""
            Response.Cache.SetCacheability(HttpCacheability.NoCache)
            Response.ContentType = "application/vnd.xls"
            Response.Write(strExcel)
            Response.End() Go to the complete details ...