Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
how format TOC item expression ?
c031917
Hi,
I have a report grouped by date/time in mothly intervals.
Group header is formatted with custom format MMMM yy. The reports thus shows
Apr 08
May 08
Perfect.
But in the TOC I see
..
20.04.2008 09:17
06.05.2008 15:48
..
Can I format the toc item expression row["timestamp"] with something like
<VALUE-OF format="MMMM">row["timestamp"]</VALUE-OF> ?
Can't google any solution on that.
I'm on BIRT 2.2.0
Peter
Find more posts tagged with
Comments
JasonW
One way of doing this is to alter the toc expression like:
importPackage(Packages.java.text);
dateFormat = new java.text.SimpleDateFormat("MMM-yy");
dateFormat.format(row);
See example report attached
c031917
Thanks Jason,
this works! Dates in TOC now show Apr-08...
If I now could find the right syntax to switch localization to German, I'd be happy.
I tried to use getDateInstance(), but my Java knowledge isn't sufficient to make it work.
Peter
JasonW
Try
importPackage(Packages.java.text);
importPackage(Packages.java.util);
loc = Locale.GERMAN;
dateFormat = new java.text.SimpleDateFormat("MMM-yy", loc);
dateFormat.format(row);
c031917
Great! works perfect!
Thanks a lot
Peter