Export to Excel issue...

  • Thread starter Thread starter karthick
  • Start date Start date
K

karthick

Hi,

I am exporting a Gridview to Excel and it works fine without any
issues.

But as one of the field holds values such as "71646E100" it gets
converted to: "7.16E+104" (like a formula) in Excel. How can I prevent
this from happening ?. I need to value to be in Excel as it is
displayed in the Gridview (on the web page).

Any help is much appreciated. Thanks.

Karthick
 
karthick said:
Hi,

I am exporting a Gridview to Excel and it works fine without any
issues.

But as one of the field holds values such as "71646E100" it gets
converted to: "7.16E+104" (like a formula) in Excel. How can I prevent
this from happening ?. I need to value to be in Excel as it is
displayed in the Gridview (on the web page).

Any help is much appreciated. Thanks.

Karthick

That's not a formula. It's exponential notation. It assumes 71646E100 means
71646 * (10 ** 100). Same thing as 7.15 * (10 ** 104).

I don't know how to circumvent the problem. If you were doing Excel OLE
Automation, you could try setting the number format. The other thing you
can do if it's text is output it with a single quote in front of it, and
then Excel will treat it as text no matter what.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
 
Back
Top