2014-06-26 43 views
0

如何根據特定報告區域設置的語言顯示國家名稱?賈斯珀報告區域明智的國家名稱

我只在數據庫中存儲國家代碼。當我使用以下代碼的國家顯示列表

new Locale("", $F{country_code}).getDisplayCountry(new Locale($P{REPORT_LOCALE})) 

但它無法正常工作會出現錯誤。

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 
1. The constructor Locale(Locale) is undefined 

有沒有什麼辦法根據報告語言顯示國家名?

回答

0

正確的代碼應該像波紋管

new Locale("", $F{country_code}).getDisplayCountry($P{REPORT_LOCALE}) 

$P{REPORT_LOCALE}返回Locale對象。