Jump to content
We've recently updated our Privacy Statement, available here ×

manikkumar

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by manikkumar

  1. Hi, I have been working on Jasper Reports since a month now. This forum has been really helpful in solving all my problems till now. But I couldn't find any solution for the "/ by Zero" exception I am getting right now. In my report I am dividing two bigdecimals and I want to display the result as a percentage on my report. The error I am getting is in the code section where $V{Sum_Infeeds}.divide($V{Sum_Total},2,BigDecimal.ROUND_HALF_UP) is the variable I have defined.$V{Sum_Total} & $V{Sum_Infeeds} are also variables, which run over the report to find out the sum of their respective columns. I am getting a '/ by zero exception'; however, I have checked that the value of my variable is not actually zero. Also, the report runs good on one of the database but throws an exception on the other database. Does anybody have an idea as to why is this happening?? Code:Error filling print... Error evaluating expression : Source text : $V{Sum_Infeeds}.divide($V{Sum_Total},2,BigDecimal.ROUND_HALF_UP)net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $V{Sum_Infeeds}.divide($V{Sum_Total},2,BigDecimal.ROUND_HALF_UP) at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:257) at net.sf.jasperreports.engine.fill.JRCalculator.evaluateEstimated(JRCalculator.java:565) at net.sf.jasperreports.engine.fill.JRCalculator.estimateVariables(JRCalculator.java:169) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:773) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1413) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:899) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:802) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:251) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:896) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) Caused by: java.lang.ArithmeticException: / by zero at java.math.BigDecimal.divide(Unknown Source) at Summary32By32HOUR_1246393018792_406802.evaluateEstimated(Summary32By32HOUR_1246393018792_406802:636) at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:246) ... 13 more Print not filled. Try to use an EmptyDataSource...
×
×
  • Create New...