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?
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...
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?
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.