#1   Report Post  
kumarappans
 
Posts: n/a
Default cell format problem

Hi,

I am generating excel automatically using jsp. I am having some of my fields
with leading zeros( like 001,002.. etc). But once I generate the excel the
leading zeros are truncated automically by excel.
My question here is how do i retain this leading zero fields without
changing the field type( as i dont dont change the data type programatically
in jsp). Also i dont want to add any special characters infront of the data.

Pl. help me to retain the field data with leading zeros.

Thanks
  #2   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

There are 3 differnt ways to have leading zeros in excel.

1. Preceede the numeric string with an ampersand, like '001. Such entrie is
interpreted by Excel as text string "001".

2. Format the cell as text before entering the value.

3. Format the cell as Custom "000". Unlike other two, the entry is numeric,
so you can use it in mathematical expressions without any need to convert it
before.

PS. For first 2 ways, "001"<"1", for last one 001=1


--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)


"kumarappans" wrote in message
...
Hi,

I am generating excel automatically using jsp. I am having some of my

fields
with leading zeros( like 001,002.. etc). But once I generate the excel the
leading zeros are truncated automically by excel.
My question here is how do i retain this leading zero fields without
changing the field type( as i dont dont change the data type

programatically
in jsp). Also i dont want to add any special characters infront of the

data.

Pl. help me to retain the field data with leading zeros.

Thanks



  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Minor English correction.

1. Preceede the numeric string with an ampersand, like '001. Such entrie is
interpreted by Excel as text string "001".


apostrophe = '
ampersand = &



Arvi Laanemets wrote:

Hi

There are 3 differnt ways to have leading zeros in excel.

1. Preceede the numeric string with an ampersand, like '001. Such entrie is
interpreted by Excel as text string "001".

2. Format the cell as text before entering the value.

3. Format the cell as Custom "000". Unlike other two, the entry is numeric,
so you can use it in mathematical expressions without any need to convert it
before.

PS. For first 2 ways, "001"<"1", for last one 001=1

--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)

"kumarappans" wrote in message
...
Hi,

I am generating excel automatically using jsp. I am having some of my

fields
with leading zeros( like 001,002.. etc). But once I generate the excel the
leading zeros are truncated automically by excel.
My question here is how do i retain this leading zero fields without
changing the field type( as i dont dont change the data type

programatically
in jsp). Also i dont want to add any special characters infront of the

data.

Pl. help me to retain the field data with leading zeros.

Thanks


--

Dave Peterson
  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi Dave

Thanks for correcting me! (I had some vague feeling that something was
wrong, when writing my answer.)


Arvi Laanemets


"Dave Peterson" wrote in message
...
Minor English correction.

1. Preceede the numeric string with an ampersand, like '001. Such entrie

is
interpreted by Excel as text string "001".


apostrophe = '
ampersand = &



Arvi Laanemets wrote:

Hi

There are 3 differnt ways to have leading zeros in excel.

1. Preceede the numeric string with an ampersand, like '001. Such entrie

is
interpreted by Excel as text string "001".

2. Format the cell as text before entering the value.

3. Format the cell as Custom "000". Unlike other two, the entry is

numeric,
so you can use it in mathematical expressions without any need to

convert it
before.

PS. For first 2 ways, "001"<"1", for last one 001=1

--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)

"kumarappans" wrote in message
...
Hi,

I am generating excel automatically using jsp. I am having some of my

fields
with leading zeros( like 001,002.. etc). But once I generate the excel

the
leading zeros are truncated automically by excel.
My question here is how do i retain this leading zero fields without
changing the field type( as i dont dont change the data type

programatically
in jsp). Also i dont want to add any special characters infront of the

data.

Pl. help me to retain the field data with leading zeros.

Thanks


--

Dave Peterson



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display cell value on a chart. Andrew Constantinidis Charts and Charting in Excel 1 January 8th 05 05:36 AM
How do I set a cell to "Empty" so that it does not display in a ch Ian Charts and Charting in Excel 3 January 7th 05 02:12 AM
make a cell empty based on condition mpierre Charts and Charting in Excel 2 December 29th 04 02:01 PM
Cell value as chart scale maximum Phil Hageman Charts and Charting in Excel 9 December 17th 04 03:09 PM
Transferring cell content between workbooks using cell references Kiwi Mike Excel Discussion (Misc queries) 2 November 28th 04 12:31 AM


All times are GMT +1. The time now is 09:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"