mrogge Posted November 30, 2009 Share Posted November 30, 2009 I have created two variables that summarize the results of two different fields. I would like to divide the results of these variables into each other. I am receiving an error that states "integer cannot be resolved to a type" when I write the following expression as a separate variable:new integer ($V{pm_fund_ct}/$V{pm_disp_ct})The two variable fields included in the expression are type "long." Can someone help me write this expression so I can return the result of dividing these two variables into each other. The result should be an integer that I can convert to a percentage.Thanks.Mitch Link to comment Share on other sites More sharing options...
kchaudhry Posted December 1, 2009 Share Posted December 1, 2009 Create a new textfield and set the Textfield Expression Class to java.lang.Double and paste the following in the textfield expression:new Double($V{pm_disp_ct}.doubleValue() == 0 ? 0 :($V{pm_fund_ct}.doubleValue()/$V{pm_disp_ct}.doubleValue())) Link to comment Share on other sites More sharing options...
chandrasekhargeceindia.co Posted February 1, 2016 Share Posted February 1, 2016 how can we divide the variable that is coming from subreport return value.?here im facing this problem. net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $V{threephase}.doubleValue()/$V{returnValue}.doubleValue() at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:244) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1016) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:504) at net.sf.jasperreports.engine.fill.JRFillTextField.resolveElement(JRFillTextField.java:936) at net.sf.jasperreports.engine.fill.JRFillElement.performDelayedEvaluation(JRFillElement.java:983) at net.sf.jasperreports.engine.fill.JRFillElement.resolveElement(JRFillElement.java:1085) at net.sf.jasperreports.engine.fill.ElementEvaluationAction.execute(JRBaseFiller.java:2423) at net.sf.jasperreports.engine.fill.JRBaseFiller.resolveBoundElements(JRBaseFiller.java:1609) at net.sf.jasperreports.engine.fill.JRBaseFiller.resolveReportBoundElements(JRBaseFiller.java:1636) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1077) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:319) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:158) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:932) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:87) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:276) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:745) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:891) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044) 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