Home
Analytics
Getting exception in report as Outer Query result does not exist. How to handle this exception?
ASalunkhe
<p>Hi,</p><p> </p><p>I have developed one report. Let me explain you structure of my report. List is containing two tables .List and both the tables are having different data binding. Taking value from List and using that value in filter in these</p><p>two tables. </p><p> </p><p>Now the issue is , I am getting below exception whenever there are no records in dataset for given parameters.</p><p> </p><p>Exception :</p><p> </p><div>org.mozilla.javascript.EvaluatorException: The outer query results does not exist. This might be caused by a "_outer" reference in a query without parent query. (unnamed script#10198)</div><div>at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)</div><div>at org.mozilla.javascript.Context.reportRuntimeError(Context.java:938)</div><div>at org.mozilla.javascript.Context.reportRuntimeError(Context.java:994)</div><div>at org.eclipse.birt.data.engine.script.JSResultSetRow.get(JSResultSetRow.java:121)</div><div>at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1617)</div><div>at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1437)</div><div>at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1423)</div><div>at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3027)</div><div>at script(unnamed script:10198)</div><div>at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)</div><div>at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)</div><div>at org.mozilla.javascript.SecurityController$1.exec(SecurityController.java:193)</div><div>at org.eclipse.birt.report.engine.javascript.ScriptUtil$1.execWithDomain(ScriptUtil.java:59)</div><div>at org.mozilla.javascript.SecurityController.callWithDomain(SecurityController.java:189)</div><div>at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2474)</div><div>at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)</div><div>at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)</div><div>at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)</div><div>at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)</div><div>at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawScript(JavascriptEvalUtil.java:95)</div><div>at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScript(JavascriptEvalUtil.java:134)</div><div>at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:1001)</div><div>at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.doEvaluateRawExpression(ExprEvaluateUtil.java:281)</div><div>at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.doEvaluateRawExpression(ExprEvaluateUtil.java:405)</div><div>at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.evaluateConditionExpression(ExprEvaluateUtil.java:513)</div><div>at org.eclipse.birt.data.engine.impl.FilterByRow$FilterByRowHelper.process(FilterByRow.java:341)</div><div>at org.eclipse.birt.data.engine.impl.FilterByRow.process(FilterByRow.java:211)</div><div>at org.eclipse.birt.data.engine.executor.cache.RowResultSet.processFetchEvent(RowResultSet.java:160)</div><div>at org.eclipse.birt.data.engine.executor.cache.RowResultSet.doNext(RowResultSet.java:121)</div><div>at org.eclipse.birt.data.engine.executor.cache.RowResultSet.next(RowResultSet.java:91)</div><div>at org.eclipse.birt.data.engine.executor.cache.ExpandableRowResultSet.next(ExpandableRowResultSet.java:63)</div><div>at org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper.populateData(SmartCacheHelper.java:316)</div><div>at org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper.initInstance(SmartCacheHelper.java:285)</div><div>at org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper.getResultSetCache(SmartCacheHelper.java:246)</div><div>at org.eclipse.birt.data.engine.executor.cache.SmartCache.<init>(SmartCache.java:73)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.PassUtil.populateOdiResultSet(PassUtil.java:153)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.PassUtil.pass(PassUtil.java:62)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.FilterCalculator.doFiltering(FilterCalculator.java:116)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.FilterCalculator.applyFilters(FilterCalculator.java:89)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.FilterCalculator.applyFilters(FilterCalculator.java:63)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.RowProcessUtil.applyFilters(RowProcessUtil.java:177)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.ResultSetProcessUtil.doRowFiltering(ResultSetProcessUtil.java:333)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.ResultSetProcessUtil.populateResultSet(ResultSetProcessUtil.java:102)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.ResultSetProcessUtil.doPopulate(ResultSetProcessUtil.java:85)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.PassManager.prepareQueryResultSet(PassManager.java:108)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.PassManager.pass(PassManager.java:126)</div><div>at org.eclipse.birt.data.engine.executor.transform.pass.PassManager.populateResultSet(PassManager.java:74)</div><div>at org.eclipse.birt.data.engine.executor.transform.ResultSetPopulator.populateResultSet(ResultSetPopulator.java:198)</div><div>at org.eclipse.birt.data.engine.executor.transform.CachedResultSet.<init>(CachedResultSet.java:171)</div><div>at org.eclipse.birt.data.engine.executor.dscache.DataSourceQuery.execute(DataSourceQuery.java:201)</div><div>at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:441)</div><div>at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:1495)</div><div>at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:232)</div><div>at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:173)</div><div>at org.eclipse.birt.report.engine.data.dte.QueryResultSet.<init>(QueryResultSet.java:115)</div><div>at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:176)</div><div>at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:80)</div><div>at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:267)</div><div>at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1905)</div><div>at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)</div><div>at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)</div><div>at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)</div><div>at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)</div><div>at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)</div><div>at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)</div><div>at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:441)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:442)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:442)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:442)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:442)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:442)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.handleVisibility(HTMLAbstractLM.java:374)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:123)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)</div><div>at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)</div><div>at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)</div><div>at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:260)</div><div>at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:111)</div><div>at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.createReportDocument(ReportLauncher.java:626)</div><div>at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.renderReport(ReportLauncher.java:549)</div><div>at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.run(ReportLauncher.java:455)</div><div>at org.eclipse.birt.report.debug.internal.core.launcher.ReportLauncher.main(ReportLauncher.java:104)</div><div>at org.eclipse.birt.report.debug.internal.core.ReportDebugger.start(ReportDebugger.java:39)</div><div>at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)</div><div>at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)</div><div>at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)</div><div>at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)</div><div>at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)</div><div>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</div><div>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</div><div>at java.lang.reflect.Method.invoke(Method.java:597)</div><div>at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)</div><div>at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)</div><div>at org.eclipse.equinox.launcher.Main.run(Main.java:1408)</div><div>at org.eclipse.equinox.launcher.Main.main(Main.java:1384)</div><div> </div><div>How can I handle this exception ?</div><div> </div><div>Any help would be appreciated!! Thanks in Advance !!</div>
Find more posts tagged with
Comments
kclark
<p>Can you post the rptdesign?</p>
ASalunkhe
<p>Hi,</p><p> </p><p>It's not possible to post the design here. But I can try to explain you issue in detail. As I am using nested structure in my report (i.e. two tables inside List) , and passing value from List to tables , if list does not contain any value (means dataset is not returning any value for provided parameters), tables are failing to refer the column from List , giving error as <strong>"[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]: The outer query results does not exist. This might be caused by a "_outer" reference in a query without parent query. ".[/color]</strong></p><p> </p><p>One more thing is , data binding is different for List and table.</p><p> </p><p><strong>Filter used in table is :</strong></p><p> </p><div>Cuserid(userid in table) <strong>equal to</strong> row._outer["UserID"] (Userid from List)</div><div> </div><div>I also tried with expression like "if (row._outer["UserID"]!=null)</div><div>{</div><div>row._outer["UserID"];</div><div>}</div><div>else if (row._outer["UserID"]==null)</div><div>{</div><div>null;</div><div>}"</div><div> </div><div>But it also didn't work as it is failing to refer query result.</div><div> </div><div>This report works perfectly when dataset returns records but failing for null values.</div><p> </p><p>How can I handle this exception and give error message to user as "No records found" ?</p><p> </p><p>Thanks,</p><p>Akshay.</p>
kclark
<p>Since you don't need the table if there isn't any data you could check to see if anything was returned in the onFetch() of the dataset. If there wasn't you could drop the table that is throwing that error. <a data-ipb='nomediaparse' href='
http://www.birt-exchange.org/devshare/_/designing-birt-reports/1027-drop-a-table-based-on-a-report-parameter'>This
devshare</a> has an example showing how to drop a table, you'll need to make sure it's named first.</p>
ASalunkhe
<p>Hi Kclark,</p><p> </p><p>Thanks for response. But how can I know if dataset is returning any value and in example provided by you , table is being dropped in Beforefactory and that time we don't have access to dataset and how can I access to dataset in beforefactory ? </p><p> </p><p>Is it possible to drop table in onfetch event of dataset ? I tried this but I still got the error.</p><p> </p><p>Thanks,</p><p>Akshay.</p>
ASalunkhe
<p>IS there anyone who can help me to resolve this issue ?</p>
kclark
<p><a data-ipb='nomediaparse' href='
http://www.birt-exchange.org/devshare/_/designing-birt-reports/1542-data-engine-api-to-check-data-set-values'>I
think this</a> might be a better way to drop the table. You would use the DEAPI to check if any data was returned. You should be able to use this approach in the beforeFactory()</p>
ASalunkhe
<p>Hi Kclark,</p><p> </p><p>I resolved the issue . I added one more dataset , took dummy row in that like "Select 1 as empid from emp" .So this dataset will always have value .Then took union of this dataset and my final dataset. So union of these two datset will never result into null value and then filtered dummy value on report and report is working absolutely fine.
</p><p> </p><p>So this way I am not getting that exception now.
</p><p> </p><p>Thanks for all your help. Much appreciated.</p><p> </p><p>Thanks,</p><p>Akshay.</p>