Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
While exporting the data to the excel leading zeros are not displaying in export to excel.What is the solution for this.
Posted
Updated 10-Feb-17 4:53am
Comments
Dholakiya Ankit 20-Jul-13 6:55am    
put some code show us where u stuck

That's because Excel is reading it and seeing it as a number - so it strips all leading zeros.

Format the Excel column as text before you set the values, and it'll work fine.

[edit]
See here for an example: http://stackoverflow.com/questions/2067926/format-an-excel-column-or-cell-as-text-in-c[^]
[/edit]
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900