Click here to Skip to main content
15,943,148 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Expert,

I have a datagridview. When i Export it o Excel leading zero got truncated.
I have tried to add one single comma(') during writing to Excel but it show
the added comma(').

Below is my sample data: -

5001 13000001 '0003
5001 13000001 '0014
5002 13000002 '0014
5002 13000002 '0014

I want to produce the result in excel as below without comma('): -

5001 13000001 0003
5001 13000001 0014
5002 13000002 0014
5002 13000002 0014


Anil Kumar
Milfje 27-May-15 5:06am    
How do you store this number in your program? And what is the cell value in Excel (check the formula bar), it might just be the formatting that truncates the leading zero, not the actual exported value.

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