Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT Viewer CSV Export Issue
yrraja
Hi
I have a report with a table which contains a timestamp column (type "Date Time"). The timestamp column is showing the time till milliseconds and also contains the timezone information. The report display the timestamp as expected BUT when the table is exported in the CSV format using the birt viewer's "Export Data", the timestamp gets truncated. For example i have the following timestamp:
In BIRT Report = 2012-08-24 05:16:23.257 CDT
In the CSV file exported via BIRT viewer = Aug 24, 2012 5:16 AM
Any idea how i can get the seconds/milliseconds and the timezone in the exported CSV file?
Thanks
Y
BIRT Viewer 3.7.2
Find more posts tagged with
Comments
mwilliams
Do you format the date time for the report output?
yrraja
Yes i am formatting the time stamp column. Under the properties section "Format DateTime" i am using the following custom setting:<br />
yyyy-MM-dd HH:mm:ss.SSS z<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="108867" data-time="1346094720" data-date="27 August 2012 - 12:12 PM"><p>
Do you format the date time for the report output?<br /></p></blockquote>
mwilliams
Try creating a computed column in your dataSet of type dateTime with this expression:
importPackage(Packages.java.text);
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS z");
df.format(row["yourDateField"]);
Then, use this new computed column in your report, instead. Delete the other dateField binding from the binding tab in your element. That might do it. I have not tested this.
yrraja
Thanks for the tip. I will test it out and will let you know how it goes.
yrraja
Hi Michael
I tried out this work-around and it worked fine.
Now the problem is that i have a lot of reports which use timestamps and this means that i will need to make this tweak in each one of them. Is there some way i can make the BIRT viewer to csv export the timestamp values in the format they are visible in the report?
Thanks
Yaser
mwilliams
You could try this plugin that was submitted in a past contest:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1417-csv-emitter-plugin-for-birt/
Or take a look at this:
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/866-using-the-csv-emitter-with-birt-2.3.0/
Or you could always write your own CSV emitter.