Skip to main content



      Home
Home » Archived » BIRT » Locale date formatting in Dynamic Text
Locale date formatting in Dynamic Text [message #133666] Tue, 21 February 2006 14:32 Go to next message
Eclipse UserFriend
Originally posted by: dave.gross.logiclibrary.com

What is the correct way to get a date formatted in the current locale if it
is used in an HTML/Dynamic Text item where there may be other text
interspersed? For example:

<b>Date:</b> <value-of>row["MYDATE"]</value-of>

I want the date column to be formatted as mm/dd/yy for US and dd/mm/yy for
FR, for example.

If I separate the text and the date data into different grid elements, I can
easily take the MYDATE column and use Format DateTime on the Property Editor
which is locale sensitive. But sometimes layout can be difficult to
control, so I would like to do it within a Dynamic Text item if possible.

I didn't see any standard functions that helped with date formatting using
locale.

Thanks,
-- Dave
Re: Locale date formatting in Dynamic Text [message #133867 is a reply to message #133666] Wed, 22 February 2006 01:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: juergen.schwarz.gefasoft.de

Dave Gross schrieb:
> What is the correct way to get a date formatted in the current locale if it
> is used in an HTML/Dynamic Text item where there may be other text
> interspersed? For example:
>
> <b>Date:</b> <value-of>row["MYDATE"]</value-of>
>
> I want the date column to be formatted as mm/dd/yy for US and dd/mm/yy for
> FR, for example.

You could try something like that (which I use to display the current
date according to the reports Locale):

<value-of> java.text.DateFormat.getDateInstance(java.text.DateFormat.SH ORT,reportContext.getLocale()).format(new
java.util.Date())</value-of>
Re: Locale date formatting in Dynamic Text [message #134216 is a reply to message #133867] Wed, 22 February 2006 09:59 Go to previous message
Eclipse UserFriend
Originally posted by: dave.gross.logiclibrary.com

Thanks, Jurgen.
Previous Topic:Table visibility in PDF
Next Topic:Exporting chart images cretaed for a report to have a cached version of it
Goto Forum:
  


Current Time: Mon Jun 09 20:16:12 EDT 2025

Powered by FUDForum. Page generated in 0.07691 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top