Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting to XLs from ASP

Status
Not open for further replies.

Norman55

Programmer
Apr 27, 2006
48
GB
When exporting to XLS from a web page, if my recordset is below a thousand records, it works fine but when I have a larger recordset, it falls over and only exports a few fields and includes all of the formatting code as well. Can anyone help? [sadeyes]
 
i would suggest you to first export it to the comma delimited text file and then you can work it from there...

-DNG
 
you just need to change the response.contenttype to CSV instead of ms-excel...

-DNG
 
It sounds to me like one of the records being pulled in contains a character like a quote that is being interpreted by the script as an end quote for a value and then dumping the rest of the data as text instead of HTML. It could also be < or > or something along those lines.
Look at the HTML that dumps as text to the screen to get an idea where the exact break occurs to make it easier to track down. Also look at the record that last printed so you know where to look in your data (either that record or the next one pulled according to your query).


It's hard to think outside the box when I'm trapped in a cubicle.
 
yes i think theniteowl suggestion is a good one...i would first check that...i was suggesting to export it as csv only if your recordset is larger than what excel can hold...

-DNG
 
I am trying to export 43107 records. if i take the <% Response.ContentType = "application/vnd.ms-excel"%> code out there are too many records for the page to handle and the page cannot be displayed!
If <% on error resume next%> is at the top of the page some records are displayed but not all and not correctly formatted.
Could this be the problem ?
If so do you have anymore tips as Excell can handle approx 64000?
 
try putting this on the top of your page...

<%Response.Buffer=TRUE%>

-DNG
 
how about this:

Response.Clear
Response.ContentType = "application/vnd.ms-excel"


-DNG
 
Got that to
<%
Response.Clear
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
%>
 
Is it possible the page execution is timing out on the server and your just seeing what was sent to the browser before it timed out? How long does it execute before it stops trying to load the page?

When you take out the On Error Resume Ne3xt, do you get any errors printed out?

Are you attempting to do any type conversions before printing that might fail, such as doing a cInt on a field that might have a null for one of the values?


My first guess is that this is a performance issue, but that is just a guess. The previous quesitons may help find the problem/solution.

-T

barcode_1.gif
 
Response object error 'ASP 0251 : 80004005'

Response Buffer Limit Exceeded

/test/test.asp, line 0

Execution of the ASP page caused the Response Buffer to exceed its configured limit

i am not trying to do any conversions first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top