jasper报告与区域设置相关的Java DynamicReports格式日期
我正在使用DynamicReports API构建报告
我正在设置报告的区域设置,并格式化报告的日期列,但无论区域设置是什么,日期的格式始终为10/12/2009 10:54:44AM
代码如下所示:
rep.setTemplate(Templates.reportTemplate.setLocale(res.getLocale()));
...
if (rs.getString(i).contains("00:00:00"))
rep.addColumn(col.column(title, name, type.dateType()));
else
rep.addColumn(col.column(title, name, type.dateYearToSecondType()));
是否有一种方法可以自动格式化与报告的区域设置相关的日期,或者让我使用自定义的值格式化程序
# 1 楼答案
我还尝试了参数映射,但没有成功
无法自动设置日期的格式。 唯一的方法是对区域设置的日期列使用模式
# 2 楼答案
我用这种方式在动态jasper中设置了日期字段的格式