There a couple of ways you could do this. You could use a text element
instead of a data element and do something like:
in your data item expression do something like:
importPackage( Packages.java.text );
var sdf = new SimpleDateFormat("MM/dd/YYYY", reportContext.getLocale());
var myformatteddate = sdf.format( row["date"]);
row["number"]+' of ' + myformatteddate.
On 2/4/2011 12:16 PM, nicola wrote:
> I have a dynamic text which should display:
> Exam n. 1234/2011 of 01/04/2010
> Inside the dynamic I have
> 'Exam n. ' + row["number"] + ' of ' + row["date"]
> but the result is:
> Exam n. 1234/2011 of Thu Apr 01 00:00:00 CEST 2010
> How can I format the date inside a dynamic text?
> Should I do it from sql side?
> Thank you
I'd lean toward doing it on the SQL side.
If you have to do it in the BIRT side, you'll need to reference the Java SimpleDateFormat library (I think) and make calls using those methods. Someone else can probably point you to examples.