Click here to Skip to main content
12,813,994 members (32,843 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# 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


Anil Kumar
Posted 29-Jan-13 0:47am
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)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 26 May 2015
Copyright © CodeProject, 1999-2017
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