Search code examples
javasqljasper-reportsdynamic-reports

DynamicReports Eliminates Time Portion Of Date Fields


I am using dynamic-reports to create reports based on Jasper-reports.

I have encountered this odd problem that When I am creating reports that contains columns with Timestamp values, the time portion of those values got eliminated and values of those columns in the report are shown without their time portion, For example, I expect 2013-03-12 23:10:10.2 but get 2013-03-12 0:0:0.0.

I am using DataTypes.dateYearToSecondType() type of dynamicreports data types.

I am currently using jasperreports-5.5.1 and dynamicreports-3.2.1

Any help will be apreaciated.


Solution

  • the trick is to use this column definition instead :

    TextColumnBuilder column = col.column(..., Timestamp.class).setPattern("yyyy-MM-dd HH:mm.sss");

    as ricardo mariaca answered here