Hi world.

Somehow it's depending on the template.

Using templates where cells have to be created instead of updated the
things work well.
Using templates where cells are overwritten (even if we explicitly want
to write the things as strings) Excel is so stubborn that the old
formatting is still influencing in a bad way.

Does anybody have an idea how to force Excel to forget such old things?

Not having to mind about the history of an Excel file (what happened
before; just emptying some cells for using it as a template) is much
easier to maintain. (Keep It Simple and Straight.)

Regards,        Karl-Heinz.


-----Urspr�ngliche Nachricht-----
Von: Karl-Heinz Zengerle [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 21. April 2004 18:41
An: 'POI Users List'
Betreff: AW: how to force to be a string cell

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]


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

Reply via email to