Formatting problem while exporting a web page in ms-excel in using C#

Posted by Krishnasamy2008 under ASP.NET on 8/2/2011 | Points: 10 | Views : 1982 | Status : [Member] | Replies : 1
I am using Asp.Net 2.0 and C# 2005. I have created a web page and i am exporting that page in excel,but the problem is that when the page gets displayed in ms excel the format is getting changed.That is total value is a column in grid and 2345000098.90 is a row in that column ( here 2345000098.90 is the total value) then in the excel page it is showing as 234500009890 something like this.This is just an example of the error that i am facing.I want the total value in the same format as it is.I dont want the format to change.

In default total value change decimal to general in excel sheet.

Please help and provide with ur valuable suggestions.

Thanks and Regards,


Posted by: Kresa on: 8/2/2011 [Member] Starter | Points: 25

You need to set decimal places .By default the Excel cell format is taken this way only.

you will refer the following link


Krishnasamy2008, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response