solene.masseron Posted April 20, 2023 Posted April 20, 2023 Hello everyone,I have a stop data stored in a postgres database from which I create a report. In this data I have a column that stores yes and no values I would like to count by municipality.I created a variable a parameterized variable as belowthe problem is that I have an error message like the following image and I don't know what to do.I am a beginner on this software if anyone has an idea with great pleasure =) net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: $V{countNo} at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:551) at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$18(ReportController.java:526) at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:444) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)Caused by: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: $V{countNo} at net.sf.jasperreports.engine.fill.JREvaluator.handleEvaluationException(JREvaluator.java:294) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:328) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:673) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:641) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1173) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:555) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:540) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:548) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2600) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeader(JRVerticalFiller.java:662) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeaders(JRVerticalFiller.java:558) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:264) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:621) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135) at java.base/java.lang.Thread.run(Unknown Source)Caused by: java.lang.ClassCastException: Cannot cast java.lang.Integer to java.lang.String at java.base/java.lang.Class.cast(Unknown Source) at net.sf.jasperreports.compilers.JavaDirectExpressionValueFilter.filterValue(JavaDirectExpressionValueFilter.java:47) at net.sf.jasperreports.compilers.StandardExpressionEvaluators.filterValue(StandardExpressionEvaluators.java:177) at net.sf.jasperreports.compilers.StandardExpressionEvaluators$VariableEvaluator.evaluate(StandardExpressionEvaluators.java:280) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:309) ... 15 more
Tirupathi Mangalarapu Posted April 20, 2023 Posted April 20, 2023 Typically you can review the stack trace "Caused by:" which saysCaused by: java.lang.ClassCastException: Cannot cast java.lang.Integer to java.lang.StringChange the data type from string to a numeric value in this case to an integer and try again.
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