473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem with Excel export

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()


Jul 20 '06 #1
2 965
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
Jul 20 '06 #2
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
Jul 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matt | last post by:
I have an ASP page that calls ASP routines that I created that execute a database query and return the results to a recordset. I then iterate through the recordset and display the data in a table....
4
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear"...
3
by: Bidarkota | last post by:
When i export DataGrid to Excel all the HTML contents are also exporting to excel. i am using stylesheets in the ASPX Page and i am getting an alert message that stylesheets are missing. i need to...
4
by: Prasad Dannani | last post by:
Hi, We have to export our data in sql server table to any excel sheet. We have a template to export, using oledb we are inserting rows to this template and generating the excel output. The...
5
by: al | last post by:
Greetings, I used article Q317109 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q317109) to solve the problem of Excel prcocess does not stop after close. The problem I faced with...
4
by: msnnews.msn.com | last post by:
hi there, i've got a form that populates a datagrid, and a button that calls a function to export to an excel file. All is well with the export, no errors are returned, but the Excel instance...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
1
by: forumaic | last post by:
Hello, I am trying to export data to excel from datagrid, and I am getting an error: "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." ...
9
by: QCLee | last post by:
Sir can you help me to transfer my Access Query to MS excel? i have a command button on the form to export the parameter query named "HVACWindwardQuery" to excel spreadsheet and i got the codes...
0
by: mustaqueahmad | last post by:
Hi All, I am getting export to excel problem when I am giving IPAddress in URL, but it is working correct when am giving localhost and page name. eg : when I am writing My machine IP...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.