【发布时间】:2015-04-28 15:45:04
【问题描述】:
这是我的 jrxml 的摘录:
<textField>
<textFieldExpression><![CDATA["Exported on " + new java.text.SimpleDateFormat("dd-MMM-yyyy HH:mm:ss z").format(new java.util.Date(), java.util.Locale.US)]]></textFieldExpression>
</textField>
使用 Jaspersoft Studo 6.0.4.Final 进行编译时出现此错误:
Errors were encountered when compiling report expressions class file:
1. The method format(Date, StringBuffer, FieldPosition) in the type SimpleDateFormat is not applicable for the arguments (Date, Locale)
value = "Exported on " + new java.text.SimpleDateFormat("dd-MMM-yyyy HH:mm:ss z").format(new java.util.Date(), java.util.Locale.US); //$JR_EXPR_ID=28$
这看起来很奇怪,因为SimpleDateFormat 没有任何format(Date, StringBuffer, FieldPosition) 方法!
【问题讨论】:
标签: jasper-reports simpledateformat date-formatting