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.
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://support.microsoft.com/kb/81518
http://www.netomatix.com/development/gridviewcustomdataformatting.aspx
help?