ksk Posted May 22, 2015 Posted May 22, 2015 I'm try to do a json subreport connected to the Northwind sample database and I'm reading all over that I need the following expression in the subreport DataSourceExpression:((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("Orders")Yet, when I try to put it in the expression editor it tells me:The current expression is not valid. Please verify it!Any ideas what I'm doing wrong?
malkav.82l03 Posted July 19, 2015 Posted July 19, 2015 Hello,I have a similar problem. Did you solved it? Can you post the jrxml of the main report and of the subreport? I'm getting exception like this: Exception in thread "main" net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: ((net.sf.jasperreports.engine.data.JsonDataSource)$P{REP_DS}).subDataSource("json.Peoples") at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:264) at net.sf.jasperreport`enter code here`s.engine.fill.JRCalculator.evaluate(JRCalculator.java:610) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:578) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1015) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:454) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:345) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:454) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2029) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:262) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:122) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:551) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:411) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:122) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:983) at report.services.JSONTEST.generateReport(JSONTEST.java:105) at report.services.JSONTEST.main(JSONTEST.java:33) Caused by: net.sf.jasperreports.engine.JRException: No node available. Iterate or rewind the data source. at net.sf.jasperreports.engine.data.JsonDataSource.subDataSource(JsonDataSource.java:455) at master_1437312305950_565620.evaluate(master_1437312305950_565620:173) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:251) ... 18 more[/code]
ksk Posted July 20, 2015 Author Posted July 20, 2015 I never really got the JSON data source working but I did manage to get one working with XML. This error message is actually a bug in JasperReports because there is nothing wrong with the expression but I couldn't get them to acknowledge it or fix it. The support on these forums leaves a bit to be desired sadly.
djohnson53 Posted July 21, 2015 Posted July 21, 2015 Ksk,below, you mentioned that you couldn't get a resolution for the bug. I couldn't find a issue in the Tracker under 'ksk'...Doesn't look like you ever submitted the bug here ...
ksk Posted July 22, 2015 Author Posted July 22, 2015 I didn't know about the Tracker. The bug is above though - that expression IS valid, even though it says it isn't.
joseph.q.nacion Posted January 28, 2020 Posted January 28, 2020 I encountered this issue too and it took me a while to figure it out. Basically all you have to do is use JSON as your query language instead of jsonql.
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