Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2007, 03:37 PM
Authorized User
 
Join Date: Mar 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Missing zeros when export data to Excel using ASP

Hi Imar,

I am exporting data to excel using asp. While I am exporting to excel, I am missing zero values at the begining of the numbers. For example in database Id= 03456, when I export it to excel, it display as Id=3456. I can't keep the number as it is in database. And how do you format the excel like the way you want? For example: lines between cells or characters styles.

Can you or someone please help? Thank you in advance.

 
Old January 12th, 2007, 06:39 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Not sure why you're addressing me directly, but anyway, here's an answer.

03456 is not a number. 3456 is. AFAIK, no number has leading zeros like this. So, I think Excel does the right thing and strips of the leading zero. If you want to keep it, prefix the data with a ' to tell Excel you mean the literal value of the data. '03456 will be visible as 03456 in an Excel cell (no pun intended, although I think the people at Microsoft did)

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Everything Ends by Slipknot (Track 5 from the album: Iowa) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Export to Excel (Data only) nikks9 ASP.NET 1.0 and 1.1 Professional 3 February 9th, 2011 05:01 AM
How to export data into Excel lily611 General .NET 8 January 11th, 2006 10:02 PM
export data to excel tulincim Classic ASP Databases 0 August 22nd, 2005 03:34 PM
export data to Excel?? amy_mgfe Excel VBA 0 January 15th, 2005 10:44 AM
Importing from excel with missing data Lizu SQL Server DTS 4 September 21st, 2004 07:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.