0
這裏是我的JRXML提取物:如何在JasperReports中顯示具有特定格式和區域設置的日期?
<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)
方法!實際上