Hi world.

At an other place we store "1.2" and it's implicitly converted to 1,2.
In another cell referencing this via a formula it's even a datetime.

That things shall be strings and nothing else and they're stored as
strings.

How can that ugly side effects be suppressed?

Regards,        Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: Karl-Heinz Zengerle [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 21. April 2004 18:35
An: [EMAIL PROTECTED]
Betreff: how to force to be a string cell

Hi world.
 
In some cases we explicitly store things as strings. At the moment wenn
the cell value is set we see the value correct. But when we open Excel
afterwards we see 04.03.2004 where we have set "03/04-4".
 
Even additional forcing with e.g.
            HSSFCellStyle oCS =
this.oiShXl.getOiWBXl().getOiWBP().createCellStyle();
            oCS.setDataFormat(HSSFDataFormat.getBuiltinFormat("@"));
// text
doesn't help.
 
Because of the implicit conversion our original input is lost.
 
As a date value might be derived from several external representation
(and thus that implicit conversions aren't a bijective function in the
mathematical sense) this can't be corrected in a general manner by Excel
macros.
 
How can we force that the things remain strings???
 
A further trial was prefixing with a prime (') but this also didn't work
well and brought other problems.
 
In another application we copy a string from one cell to another
(normally empty one) via
 
      String sTmp = oCellP.getStringCellValue();
      oCellPT.setCellValue(sTmp);
 
There with the same data ("03/04-4") we don't have such problems.
 
Regards,
Karl-Heinz Zengerle
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to