Export to Excel problem

R

rwiegel

I am using the following code to export to excel:

Response.ContentType = "application/ms-excel";
Response.AddHeader("Content-Disposition", "inine;filename=text.xls");
OdbcDataReader reader = cmd.ExecuteReader();

excelGrid.DataSource = reader;
excelGrid.DataBind();
excelGrid.RenderControl(writer);

On a few rows (3 out of 623), I receive an error that the cell data is
too large. A log file is created and the data it was trying to insert
is stored in the log file. The data is all around 980 character (with
spaces). This seems way to small to be the maximum characters allowed
in an excel cell.

Does anybody have any ideas?

Thanks in advance,

Ryan
 
R

rwiegel

1) What is the "exact" error message?

2) Why are you using ODBC and not OleDb, AAMOI...?

--http://www.markrae.net

Thanks for the reply.

1) The exact error is: HTML ERROR in Cell data too large

2) The mailhost claims they only support ODBC
 
M

Mark Rae

Thanks for the reply.

1) The exact error is: HTML ERROR in Cell data too large

2) The mailhost claims they only support ODBC

The mailhost...? What mailhost...? What are you actually doing here...?
Which line is generating the error...?
 
R

rwiegel

The mailhost...? What mailhost...? What are you actually doing here...?
Which line is generating the error...?

--http://www.markrae.net

The error occurs when opening the excel file....it is an excel error
and is not caught in as an exception in the code. Its not a problem
with ODBC because all of the data gets populated fine in the datagrid,
the only problem is when it gets exported to excel. Somebody told me
that excel can hold up to 32,000 characters, but can only display 1024
in the formula bar. How can I check if the data is there? And is it
usable?
 
M

Mark Rae

but can only display 1024 in the formula bar.

That's correct:
http://support.microsoft.com/kb/211580
How can I check if the data is there?
I don't think you can through the standard worksheet - it's probably
available to functions and VBA, though...
And is it usable?
Depends what you want to use it for...

And I still don't know why you're using ODBC... :)

Or what "mailhost" is, or what it has to do with this...
 
R

rwiegel

That's correct:http://support.microsoft.com/kb/211580


I don't think you can through the standard worksheet - it's probably
available to functions and VBA, though...


Depends what you want to use it for...

And I still don't know why you're using ODBC... :)

Or what "mailhost" is, or what it has to do with this...

--http://www.markrae.net

sorry i didn't mean mailhost i meant webhost

I believe my client wants to be able to do keyword searches on the
data in the excel.....can it still find data that can't be displayed?
 
M

Mark Rae

sorry i didn't mean mailhost i meant webhost

LOL! OK, but I *STILL* don't know why you're using ODBC... :)
I believe my client wants to be able to do keyword searches on the
data in the excel.....can it still find data that can't be displayed?

This clearly isn't an ASP.NET question - I suggest you post a message in the
Excel newsgroup...
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top