Olá, estou precisando de uma máscara para mostrar corretamente os valores monetários nos relatórios do ireport, pesquisei no forum, achei essa solução em um tópico antigo:
(new DecimalFormat("#,###,##0.00")).format($F{VALOR})
quando tentei implementá-la gera esse erro:
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Cannot cast from String to Double value = (java.lang.Double)((new DecimalFormat("#,###,##0.00")).format(((java.lang.Double)field_valor.getValue()))); <--------------------------------------------------------------------------------------------------------> 2. Cannot cast from String to Double value = (java.lang.Double)((new DecimalFormat("#,###,##0.00")).format(((java.lang.Double)field_valor.getOldValue()))); <-----------------------------------------------------------------------------------------------------------> 3. Cannot cast from String to Double value = (java.lang.Double)((new DecimalFormat("#,###,##0.00")).format(((java.lang.Double)field_valor.getValue()))); <--------------------------------------------------------------------------------------------------------> 3 errors at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193) at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:127) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:109) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:535) at java.lang.Thread.run(Unknown Source
Alguem conhece alguma solução?
Obrigado