Olá amigo, por favor tem como me ajudar estou com um relatorio e tenho um String e um BigDecimal na hora de eu convertes faco assim:
new Double( $P{PERCENTUAL}.doubleValue() * $V{VALORCOMPRAMOVIMENTACAO_SUM}.doubleValue() )
o primeiro campo que é o percentual é String e o outro é BigDecimal, o BigDecimal na boa é convertido mas da este erro:
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. The method doubleValue() is undefined for the type String value = (java.lang.Double)(new Double( ((java.lang.String)parameter_PERCENTUAL.getValue()).doubleValue() * ((java.math.BigDecimal)variable_VALORCOMPRAMOVIMENTACAO_SUM.getValue()).doubleValue() )); <---------> 2. The method doubleValue() is undefined for the type String value = (java.lang.Double)(new Double( ((java.lang.String)parameter_PERCENTUAL.getValue()).doubleValue() * ((java.math.BigDecimal)variable_VALORCOMPRAMOVIMENTACAO_SUM.getOldValue()).doubleValue() )); <--------->
como resolvo isso. Grato
[color=“orange”][/color]
new Double(java.lang.Double.valueOf(STRING) * BIGDECIMAL.doubleValue());
acho q assim dá certo =P
Boa tarde amigo, fiz assim, e ainda persiste, veja o erro agora e como ficou meu code:
new Double( java .lang.Double.valueOf($P{PERCENTUAL}) * $V{VALORCOMPRAMOVIMENTACAO_SUM}.doubleValue())
o erro:
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. The operator * is undefined for the argument type(s) Double, double value = (java.lang.Double)(new Double(java.lang.Double.valueOf(((java.lang.String)parameter_PERCENTUAL.getValue())) * ((java.math.BigDecimal)variable_VALORCOMPRAMOVIMENTACAO_SUM.getValue()).doubleValue())); <-------------------------------------------------------------------------------------------------------------------------------------------------------------------> 2. The operator * is undefined for the argument type(s) Double, double value = (java.lang.Double)(new Double(java.lang.Double.valueOf(((java.lang.String)parameter_PERCENTUAL.getValue())) * ((java.math.BigDecimal)variable_VALORCOMPRAMOVIMENTACAO_SUM.getOldValue()).doubleValue())); <----------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3. The operator * is undefined for the argument type(s) Double, double value = (java.lang.Double)(new Double(java.lang.Double.valueOf(((java.lang.String)parameter_PERCENTUAL.getValue())) * ((java.math.BigDecimal)variable_VALORCOMPRAMOVIMENTACAO_SUM.getEstimatedValue()).doubleValue())); <----------------------------------------------------------------------------
nem imagino o que seja, de um help ae. T+.
new Double( (new Integer($P{PERCENTUAL}).intValue()) * ($V{VALORCOMPRAMOVIMENTACAO_SUM}.intValue()) )