Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem with Excel export

Reply
Thread Tools

Problem with Excel export

 
 
=?Utf-8?B?a2lzaG9y?=
Guest
Posts: n/a
 
      07-20-2006
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.No Cache)
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()






 
Reply With Quote
 
 
 
 
Sonu Kapoor [MVP]
Guest
Posts: n/a
 
      07-20-2006
I would probably use XML to export the data to Excel, but in that case you would require Office 2003. Besides that the file will be bigger. You might want to take a loo at

http://dotnetslackers.com/community/.../07/14/191.asp

Ht

Sonu Kapoo


---
Posted via www.DotNetSlackers.com
 
Reply With Quote
 
 
 
 
tfsmag
Guest
Posts: n/a
 
      07-20-2006
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.



Sonu Kapoor [MVP] wrote:
> I would probably use XML to export the data to Excel, but in that case you would require Office 2003. Besides that the file will be bigger. You might want to take a loo at:
>
> http://dotnetslackers.com/community/...07/14/191.aspx
>
> Hth
>
> Sonu Kapoor
>
>
> ---
> Posted via www.DotNetSlackers.com


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export to Excel (Default File Type - Excel) =?Utf-8?B?SGVtYW50IFNpcGFoaW1hbGFuaQ==?= ASP .Net 15 05-21-2009 12:01 PM
Problem with Excel reports ::::Excel 2003 Migration To Excel 2007 =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= ASP .Net 15 10-24-2007 01:34 PM
Export to excel in asp.net using excel template Grey ASP .Net 4 10-17-2007 08:08 AM
using Microsoft Excel image for Export to Excel button =?Utf-8?B?U3JpZGhhcg==?= ASP .Net 0 12-09-2005 08:58 PM
Invalid export DLL or export format =?Utf-8?B?RGF2aWQgVmFsbGU=?= ASP .Net 0 10-29-2003 11:46 AM



Advertisments