cell format problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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 = &
 
Hi Dave

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


Arvi Laanemets
 
Back
Top