Jump to content

Recommended Posts

Posted

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?

  • 1 month later...
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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]
Posted

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.

Posted

I didn't know about the Tracker.  The bug is above though - that expression IS valid, even though it says it isn't.

  • 4 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...