Link to home
Start Free TrialLog in
Avatar of sonalj
sonalj

asked on

generating Excel report from GridView results in ASP.Net 2.0

I am generating an excel report from the GridView results.
Their is a column like size and it may have a leading zero like '05'
Excel is formatting 05 as a number and displaying it as 5 .

How to retain the leading zero.


Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Avatar of sonalj
sonalj

ASKER

I fixed it like this->In Page_PrerenderComplete i have

 oRow.Cells(2).Text = " " & oRow.Cells(2).Text

The problem was when generating the excel 05 was displayed as 5 in the excel sheet not in the gridview . gridview was fine.
So appended a space there and now it displays 05 as 05 and 5 as 5.
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial