I am trying to pass a long value to a subreport. It throws the following error.
net.sf.jasperreports.engine.JRException:
net.sf.jasperreports.engine.JRRuntimeException: Unknown subreport source class
java.lang.Long
Related
Hi I am trying to develop birt cross tab report, but i am getting below error. please give me some solution to solve this.
The following items have errors:
ReportDesign (id = 1):
- A BIRT exception occurred: Can not convert the value of Bruce to Double type.. See next exception for more information.
I try to use a report on my JasperServer, which I created with the help of iReport. In iReport my report works fine and there are no errors. But when I tried to deploy the report it gives me following error in short:
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date
and the complete Error:
The server has encountered an error. Please excuse the inconvenience.
Error Message
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date
Error Trace
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setDate(JRJdbcQueryExecuter.java:649)
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setStatementParameter(JRJdbcQueryExecuter.java:577)
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.setStatementParameter(JRJdbcQueryExecuter.java:399)
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter$1.visit(JRJdbcQueryExecuter.java:332)
at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter$QueryParameter.accept(JRAbstractQueryExecuter.java:157)
at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.visitQueryParameters(JRAbstractQueryExecuter.java:646)
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createStatement(JRJdbcQueryExecuter.java:317)
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:196)
at com.jaspersoft.jasperserver.api.engine.jasperreports.util.JRTimezoneJdbcQueryExecuter.createDatasource(JRTimezoneJdbcQueryExecuter.java:168)
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1087)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:668)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1258)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:877)
at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFiller.run(BaseFillHandle.java:120)
at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$SynchronousExecutor.execute(EngineServiceImpl.java:875)
at net.sf.jasperreports.engine.fill.BaseFillHandle.startFill(BaseFillHandle.java:165)
at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$AsynchronousReportFiller.fillReport(EngineServiceImpl.java:831)
at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1658)
at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1022)
at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
I uploaded the report, got the right data source (I tested it with another report already) and imported my Resources (Subreports) and input controls. I don't know whether I missed a step or so, but I am pretty sure that I did everything required. Importing every Subreport, setting input controls declare the right path repo:mySubreports.jrxml. If you need more information please tell me ! I think I added all information required and I don't want to spam SO with useless information because I don't know which information could be useful by now as well :)
I think this has something to do with date parameters/variables in your report.
Please ensure the input control you made for the date parameters in Jasperserver are java.util.date
Also one common error i have seen myself repeating is putting a default value expresion like an empty string may be ("") for the date parameters/variables where they are declared .In this case i have seen the report works in ireport also gets upload in the server without any error but it would throw
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date Error Trace
Please check the above two points with all the date parameters of your report and update here if that works
Thanks
chandra
My question relates to an error when generating a report.
In JasperReports Server created a Single Input Control Value but when you try to generate a report I get the error:
The server has encountered an error. Please excuse the inconvenience.
Error Message
net.sf.jasperreports.engine.JRRuntimeException: Invalid type java.lang.String for parameter SelectAsset used in an IN clause; the value must be an array or a collection.
In the preview iReport everything works flawlessly. I will put the value and generates a report.
if you mean a single value by "Single Input Control Value" it should not be a collection. So
Change your SelectAsset parameter type from java.util.Collection to java.lang.String
Then redeploy your report to the server then try again.
Hi, I am using jasper reports 5.0.0.
the following code in jrxml throws exception
new java.text.DecimalFormat("#,###").format($P(xyz))
throws an expression evaluation exception.
Where as I change this to
new java.text.DecimalFormat("#,###").format(Double.valueOf($P(xyz))),
the exception is gone.
Why?? Any help is appreciated,
Thanks
In report Parameter Value expression of the Input parameter must be different than Input control value which you are passing through input control.
I am developing report containing sub report using iReport and i am passing two external parameters in master report: the CurrWeek and CurrYear parameters. I'm passing the same parameters to the subreport.
In both reports I declared parameters as BigDecimal. When i run the report it shows the error shown bellow:
Error filling print...
net.sf.jasperreports.engine.JRException:
Incompatible java.math.BigDecimal value assigned to parameter
CurrWeek in the WeeklyReportForOtherWeek dataset.
net.sf.jasperreports.engine.JRRuntimeException:
net.sf.jasperreports.engine.JRException:
Incompatible java.math.BigDecimal value assigned to parameter
CurrWeek in the WeeklyReportForOtherWeek dataset.
This error mean that you pass wrong type from dataset to parameter.
Look at the place where you are creating (filling) dataset.