View Single Post
  #5 (permalink)  
Old September 12th, 2007, 04:07 AM
zaghmout zaghmout is offline
Friend of Wrox
 
Join Date: Aug 2006
Location: Amman, , Jordan.
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok after reading the post, I updated my code to :

************************************************** **********
           Response.Clear()
            Response.Buffer = True
            Response.Charset = "" 'You can set UTF-8 or windows-1256 but this will not solve
            Response.AddHeader("content-disposition", "attachment;filename=" & strReportName & ".xls")
            Response.ContentType = "application/vnd.ms-excel"
            Me.EnableViewState = False
            Dim stringWrite As New System.IO.StringWriter()
            Dim htmlWrite As New HtmlTextWriter(stringWrite)

            GridView1.RenderControl(htmlWrite)


            'Response.OutputStream.Write(byte(){0xef, 0xbb, 0xbf}, 0, 3)
            Response.OutputStream.Write(New Byte() {239, 187, 191}, 0, 3)

            Response.Write(stringWrite.ToString())
            Response.Flush()
            HttpContext.Current.ApplicationInstance.CompleteRe quest()
************************************************** **********

but this code solved my problem in office 2003, but I still have a problem with the office 2000 :s

guys any suggestions?




Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"