Hi Frank,

Frank Schönheit - Sun Microsystems Germany wrote (6-2-2009 10:58)
Recently I finished a new extension [1], and face some peculiarities.

Dates from a database always appear in en_US format, i.e. 2009-02-05, no matter what formatting the date field in the database (ods via odb) has.

Is there anything I can do about that (apart from offering more UI and code in fastNAW, so that the user can set preferences)?

Without trying out your extension, but as I understand it, it's a
shortcut for filling database fields in Writer documents with DB data.

That is correct.

In this case, you should be able to retrieve the formatting from the
table field which the database field is bound to (get the table column
object via the connection => getTables => getByName => getColumns =>
getByName). There is a property format key, which describes the
user-provided format of this table column. Note that it is only valid
together with the NumberFormatter which you can obtain from the data
source, format keys are *not* interchangeable between different number
formatters (at least not all of them). What is interchangeable is the
representation "locale, format string", which you can obtain from the
number formatter (don't ask me for the concrete API, I don't know out of
my head. But you're clever, you'll find it :)

Also, the database fields in Writer should have an API for specifying
how they format their value, but here I don't have the slightest idea
how this looks like, sorry.

Without working this out right now, it looks clear and a possible way to reach my goal.

Thanks for the info,

Cor


--
Cor Nouws    -    nl.OpenOffice.org marketing contact
=  "2009 - Grow OOo"   =    www.nieuwsteoffice.nl   =

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to