All source code in .Net Ask a .Net Pro Discussion Forum Categories All jobs in .Net
00000,Export,excel,with,preserve,zerosIn,offi
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
.Net Stats

 Code: 655,633. lines
 Jobs: 796. postings

 How to support the site

 
Sponsored by:
Quick Search for:  in language:    
You are in:
 
Login





Latest postings for .Net.
Click here to see a screenshot of this code!TeamVision Revisted 3.0
By ArkitechEBC on 11/16

(Screen Shot)

Click here to see a screenshot of this code!Simplest Explorer Treeview
By M1K3 on 11/16

(Screen Shot)

Click here to see a screenshot of this code!Lite Brite Application
By Brian McCumber on 11/11

(Screen Shot)

Click here to see a screenshot of this code!CAR DEALER/ CAR SALE
By YESSOUFOU ABDEL RAOUF on 11/10

(Screen Shot)

Click here to see a screenshot of this code!CPU usage tester / benchmark
By Timo Boehme on 11/16

(Screen Shot)

Arrays functions
By Jerome Scott II on 11/15


C# regex example
By Jerome Scott II on 11/15


C# list processes
By Jerome Scott II on 11/15


Click here to see a screenshot of this code!Speak and Spell
By Brian McCumber on 10/31

(Screen Shot)

Click here to see a screenshot of this code!Scratch Pad
By Brian McCumber on 11/15

(Screen Shot)

Click here to see a screenshot of this code!Alarm Clock v8
By Brian McCumber on 10/25

(Screen Shot)

ReadFile
By Does It Even Matter? on 11/14


Insert SQL Writer
By dojsys HEK on 11/13


Function to write SQL Statement
By dojsys HEK on 11/13


Click here to see a screenshot of this code!Save, Retrieve Image from Database (MSSQL)
By brandon teoh on 11/12

(Screen Shot)

Click here to see a screenshot of this code!Pic View Application
By Brian McCumber on 11/11

(Screen Shot)

Secure LAN Communicator
By ASAD SAEED CHOHAN on 11/12


Click here to see a screenshot of this code!Send Mail For CMD With System.Net.Mail
By Jimmy_to on 11/9

(Screen Shot)

sildbconn
By elumalai on 11/12


Tip
By Kaland on 11/11


Click here to see a screenshot of this code!Mail_Text Message
By Mike_ Murphy on 11/11

(Screen Shot)

Click here to see a screenshot of this code!Reaction!
By Brian McCumber on 10/25

(Screen Shot)

Alarm Clock
By bruno_RAM on 11/11


Click here to see a screenshot of this code!Instructions and procedures word or adobe to any Descktop picture icons
By ROD LEWIS on 11/10

(Screen Shot)

Dif Years Between Brothers
By Fvg@ on 11/10


Ejercicio Funcion Now & If
By Fvg@ on 11/10


Excel and VB converting (Automation)
By Kenny28 on 11/9


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   

Export to excel with preserve starting(Leading) zeros.

Print
Email
 
winzip icon
Submitted on: 11/3/2009 8:57:54 AM
By: Amit Kumar Gaur  
Level: Intermediate
User Rating: Unrated
Compatibility:ASP.NET

Users have accessed this code 554 times.
 
author picture
(About the author)
 
     Export to excel with preserve starting(Leading) zeros. =============================================================== In my office colleague was facing an interesting problem. Sql sever data was listed below: ------------------------------------------- ID EmpID EmpName Salary 1 000001 aa 1111111 2 000002 bb 2222222 3 000003 cc 3333333 4 000004 dd 4444444 5 000005 ee 5555555 6 000006 ff 6666666 7 000007 gg 7777777 8 000008 hh 8888888 9 000009 ii 9999999 10 0000010 jj 1010101 ----------------------------------------- Column EmpID was Varchar type, he was just trying export these data to MS-Excel, so first show the data by GridView and then export it as a excel file. But while opening excel file "000001" was showing as "1" and "000002" was showing as "2" and so on. the situation was "00000" were removed as below. ------------------------------------------- ID EmpID EmpName Salary 1 1 aa 1111111 2 2 bb 2222222 3 3 cc 3333333 4 4 dd 4444444 5 5 ee 5555555 6 6 ff 6666666 7 7 gg 7777777 8 8 hh 8888888 9 9 ii 9999999 10 10 jj 1010101 ----------------------------------------- He just requested me to help and I helped him. I've searched these problem in Microsoft site(MSDN) and found the solution and implemented it. now he is getting right data in excel. -Amit Gaur

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 15 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments

 There are no comments on this submission.
 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
To post feedback, first please login.


 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Games | Feedback | Customize | .Net Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997-2009 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.