Click here to Skip to main content
11,643,493 members (75,707 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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

Thanks,

Anil Kumar
Posted 28-Jan-13 23:47pm
Comments
Milfje at 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)

  Print Answers RSS
0 OriginalGriff 570
1 jyo.net 484
2 DamithSL 318
3 Afzaal Ahmad Zeeshan 253
4 CPallini 222
0 OriginalGriff 795
1 DamithSL 611
2 Mika Wendelius 494
3 jyo.net 484
4 Afzaal Ahmad Zeeshan 404


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 26 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100