Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Export to Excel problem

Reply
Thread Tools

Export to Excel problem

 
 
rwiegel@iastate.edu
Guest
Posts: n/a
 
      06-13-2007
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

 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      06-13-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

> Does anybody have any ideas?


1) What is the "exact" error message?

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


--
http://www.markrae.net

 
Reply With Quote
 
 
 
 
rwiegel@iastate.edu
Guest
Posts: n/a
 
      06-13-2007
On Jun 13, 10:37 am, "Mark Rae" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) oups.com...
>
> > Does anybody have any ideas?

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

 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      06-13-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

> 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...?


--
http://www.markrae.net

 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      06-13-2007
Get him Mark. . .

http://www.google.com/search?hl=en&q...+Excel+ASP.NET

theres all kinds of ways to export your datagrid to Excel and even make nice
and pretty charts.

Mike
'IGotYourDotNet'
http://igotyourdotnet.blogspot.com/




"Mark Rae" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>
>> 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...?
>
>
> --
> http://www.markrae.net



 
Reply With Quote
 
rwiegel@iastate.edu
Guest
Posts: n/a
 
      06-13-2007

>
> 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?

 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      06-13-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

> 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...


--
http://www.markrae.net

 
Reply With Quote
 
rwiegel@iastate.edu
Guest
Posts: n/a
 
      06-13-2007
On Jun 13, 5:24 pm, "Mark Rae" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) oups.com...
>
> > 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...
>
> --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?

 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      06-13-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...

> 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...


--
http://www.markrae.net

 
Reply With Quote
 
rwiegel@iastate.edu
Guest
Posts: n/a
 
      06-13-2007
On Jun 13, 5:44 pm, "Mark Rae" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) ups.com...
>
> > 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...
>
> --http://www.markrae.net


ok thanks for your help

 
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