anwarzamal2000 Posted December 30, 2015 Share Posted December 30, 2015 I am very new with ireport-5.6.0.How can i solve this problem.Please any one help meI have one text field(Sanctioned_intake) and one i declare variable(ROPORT_COUNT).Sanctioned_intake is nothing but total number of Student per Department and REPORT_COUNT is return total no of rows which is enter into the reportFor Example:Sanctioned Intake:140 (Total Student per Department)Actual Admitted: 10 (Actual Admission Taking)So Difference Should Be:Vacancy : 130(Remaining Vacancy )now my question is how to make difference between this twoI declare One Variableand set the following propertiesvariable class=java.math.BigDecimalCalculation SumReset Type ReportVariable Expression: $F{sanctioned_intake}.substract($V{REPORT_COUNT})but i got this errorError filling print... Error evaluating expression : Source text : $F{sanctioned_intake}.substract$V{REPORT_COUNT} net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $F{sanctioned_intake}.substract$V{REPORT_COUNT} at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:327) at net.sf.jasperreports.engine.fill.JRCalculator.evaluateEstimated(JRCalculator.java:602) at net.sf.jasperreports.engine.fill.JRCalculator.estimateVariables(JRCalculator.java:201) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1261) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1235) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1614) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:150) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:963) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:873) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:87) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:287) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:760) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:891) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.String.substract() is applicable for argument types: (java.lang.Integer) values: [1] Possible solutions: substring(int), substring(int, int) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55) at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at report7_1451461184747_723585.evaluateEstimated(calculator_report7_1451461184747_723585:564) at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:314) ... 14 more Link to comment Share on other sites More sharing options...
zh3ntil Posted December 30, 2015 Share Posted December 30, 2015 Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.String.substract()you are trying to substract and integer from string. That's not possible :) you should check the fields type. Link to comment Share on other sites More sharing options...
anwarzamal2000 Posted December 31, 2015 Author Share Posted December 31, 2015 Link to comment Share on other sites More sharing options...
anwarzamal2000 Posted December 31, 2015 Author Share Posted December 31, 2015 But how can i check the fields type. ,In xml field name and class is given. field type is not there how can i checked this?i tryed to change both class type class = "java.math.BigDecimal" and the variable which i declare to take difference also keep class type="java.math.BigDecimal" after then i got null value Link to comment Share on other sites More sharing options...
hozawa Posted December 31, 2015 Share Posted December 31, 2015 class is the datatype. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now