Problem with Excel export

G

Guest

Hi,
I have follwing code. this code is work sometimes and some time doesnot work.

There is no error mesg and many times only one instance is allowed.
does any one faced this problem ?


Kishor



Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Dim oStringWriter As New System.IO.StringWriter
Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)

dg.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.Flush()
Response.Close()
Response.End()
 
T

tfsmag

since the problem is not constant I'm going to say that the fault may
lie with the browser you're using? Sometimes if your temporary internet
files are full it will cause document rendering to fail because it has
no room to put the temp file that is created when opening a document
directly from the web. try clearing your temporary internet files and
see if that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top