joint dataset showing error

Options
sumathra
edited February 11, 2022 in Analytics #1
<p>Hi,when i joint two data set  like scripted and jdbc it showing some error ..how to rectify this</p><p> </p><p> </p><div><pre class="_prettyXprint">org.eclipse.birt.data.engine.core.DataException: Fail to execute script in function __bm_beforeOpen(). Source:
" + if (params["maingroup"].value && params["country"].value){q1=this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and country_name = '" + params["country"].value + "'"+" group by COUNTRY_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; Packages.java.lang.System.out.println ("Query1" +q1); }else if (params["maingroup"].value && params["zone"].value ){this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and zone_name = '" + params["zone"].value + "'"+ " group by ZONE_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE";}else if (params["maingroup"].value && params["state"].value ){this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and state_name = '" + params["state"].value + "'"+ " group by STATE_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE";}else if(params["maingroup"].value && params["city"].value ){this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and city_name = '" + params["city"].value + "'"+ " group by CITY_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE";}else if (params["maingroup"].value && params["Areamanager"].value ){this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and Area_manager = '" + params["Areamanager"].value + "'"+ " group by ITEM_NAME,SUB_GROUP_name,GROUP_name,area_manager,TRAN_DATE";}else if (params["maingroup"].value && params["outlet"].value ){this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and outlet_name = '" + params["outlet"].value + "'"+ " group by OUTLET_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE";}else if (params["subgroup"].value && params["country"].value ){this.queryText = this.queryText + " AND sub_Group_name = '" + params["subgroup"].value +"'"+" and country_name = '" + params["country"].value + "'"+" group by COUNTRY_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; }else if (params["subgroup"].value && params["zone"].value ){this.queryText = this.queryText + " AND sub_Group_name = '" + params["subgroup"].value +"'"+" and zone_name = '" + params["zone"].value + "'"+ " group by ZONE_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE";}else if (params["subgroup"].value && params["state"].value ){this.queryText = this.queryText + " AND sub_Group_name = '" + params["subgroup"].value +"'"+" and state_name = '" + params["state"].value + "'"+" group by STATE_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; }else if (params["subgroup"].value && params["city"].value ){this.queryText = this.queryText + " AND sub_Group_name = '" + params["subgroup"].value +"'"+" and city_name = '" + params["city"].value + "'"+" group by CITY_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; }else if (params["subgroup"].value && params["Areamanager"].value ){this.queryText = this.queryText + " AND sub_Group_name = '" + params["subgroup"].value +"'"+" and Area_manager = '" + params["Areamanager"].value + "'"+" group by ITEM_NAME,SUB_GROUP_name,GROUP_name,area_manager,TRAN_DATE"; }else if (params["subgroup"].value && params["outlet"].value ){this.queryText = this.queryText + " AND sub_Group_name = '" + params["subgroup"].value +"'"+" and outlet_name = '" + params["outlet"].value + "'"+" group by OUTLET_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; }else if (params["subgroup"].value && params["country"].value ){this.queryText = this.queryText + " AND item_name = '" + params["itemname"].value +"'"+" and country_name = '" + params["country"].value + "'"+" group by COUNTRY_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; }else if (params["itemname"].value && params["zone"].value ){this.queryText = this.queryText + " AND item_name = '" + params["itemname"].value +"'"+" and zone_name = '" + params["zone"].value + "'"+ " group by ZONE_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE";}else if (params["itemname"].value && params["state"].value ){this.queryText = this.queryText + " AND item_name = '" + params["itemname"].value +"'"+" and state_name = '" + params["state"].value + "'"+" group by STATE_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; }else if (params["itemname"].value && params["city"].value ){this.queryText = this.queryText + " AND item_name = '" + params["itemname"].value +"'"+" and city_name = '" + params["city"].value + "'"+" group by CITY_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; }else if (params["itemname"].value && params["Areamanager"].value ){this.queryText = this.queryText + " AND item_name = '" + params["itemname"].value +"'"+" and Area_manager = '" + params["Areamanager"].value + "'"+" group by ITEM_NAME,SUB_GROUP_name,GROUP_name,area_manager,TRAN_DATE"; }else {this.queryText = this.queryText + " AND item_name = '" + params["itemname"].value +"'"+" and outlet_name = '" + params["outlet"].value + "'"+" group by OUTLET_NAME,ITEM_NAME,SUB_GROUP_name,GROUP_name,TRAN_DATE"; } + "
A BIRT exception occurred. See next exception for more information.TypeError: Cannot read property "value" from undefined (<inline>#7)at org.eclipse.birt.data.engine.script.JSMethodRunner.runScript(JSMethodRunner.java:95)at org.eclipse.birt.data.engine.script.DataSetJSEventHandler.handleBeforeOpen(DataSetJSEventHandler.java:62)at org.eclipse.birt.data.engine.impl.DataSetRuntime.beforeOpen(DataSetRuntime.java:567)at org.eclipse.birt.data.engine.impl.QueryExecutor.dataSetBeforeOpen(QueryExecutor.java:214)at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:326)at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:463)at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:154)at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:159)at org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.populatePreparedQuery(PreparedJointDataSourceQuery.java:558)at org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.populatePreparedQuery(PreparedJointDataSourceQuery.java:495)at org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.access$2(PreparedJointDataSourceQuery.java:493)at org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery$JointDataSetQueryExecutor.createOdiQuery(PreparedJointDataSourceQuery.java:590)at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:330)at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:463)at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:159)at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:142)at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:136)at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:118)at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:102)at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getRuntimeMetaData(DataSetMetaDataHelper.java:194)at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getRealMetaData(DataSetMetaDataHelper.java:153)at org.eclipse.birt.report.data.adapter.impl.DataSetMetaDataHelper.getDataSetMetaData(DataSetMetaDataHelper.java:115)at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.getDataSetMetaData(DataRequestSessionImpl.java:246)at org.eclipse.birt.report.designer.data.ui.util.DataSetProvider.populateAllOutputColumns(DataSetProvider.java:221)at org.eclipse.birt.report.designer.data.ui.util.DataSetProvider.getColumns(DataSetProvider.java:177)at org.eclipse.birt.report.designer.data.ui.dataset.OutputColumnsPage.isValid(OutputColumnsPage.java:836)at org.eclipse.birt.report.designer.data.ui.dataset.OutputColumnsPage.performOk(OutputColumnsPage.java:300)at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog.okPressed(AbstractPropertyDialog.java:790)at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog.okPressed(AbstractPropertyDialog.java:775)at org.eclipse.birt.report.designer.data.ui.dataset.DataSetEditor.okPressed(DataSetEditor.java:683)at org.eclipse.birt.report.designer.data.ui.property.AbstractPropertyDialog.buttonPressed(AbstractPropertyDialog.java:650)at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:628)at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363)at org.eclipse.jface.window.Window.runEventLoop(Window.java:826)at org.eclipse.jface.window.Window.open(Window.java:802)at org.eclipse.birt.report.designer.ui.dialogs.BaseDialog.open(BaseDialog.java:111)at org.eclipse.birt.report.designer.data.ui.providers.EditableDataSetNodeProvider.performEdit(EditableDataSetNodeProvider.java:102)at org.eclipse.birt.report.designer.internal.ui.views.DefaultNodeProvider.performRequest(DefaultNodeProvider.java:472)at org.eclipse.birt.report.designer.internal.ui.views.actions.EditAction.doAction(EditAction.java:85)at org.eclipse.birt.report.designer.internal.ui.views.actions.AbstractElementAction.run(AbstractElementAction.java:70)at org.eclipse.birt.report.designer.internal.ui.views.RenameListener.doubleClick(RenameListener.java:214)at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:845)at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:843)at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1477)at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1246)at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:249)at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:246)at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:307)at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363)at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)at org.eclipse.equinox.launcher.Main.run(Main.java:1450)Caused by: org.eclipse.birt.data.engine.core.DataException: A BIRT exception occurred. See next exception for more information.TypeError: Cannot read property "value" from undefined (<inline>#7)at org.eclipse.birt.data.engine.core.DataException.wrap(DataException.java:123)at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:997)at org.eclipse.birt.data.engine.script.JSMethodRunner.runScript(JSMethodRunner.java:86)... 83 moreCaused by: org.eclipse.birt.core.exception.CoreException: TypeError: Cannot read property "value" from undefined (<inline>#7)at org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoException(JavascriptEvalUtil.java:307)at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawScript(JavascriptEvalUtil.java:106)at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScript(JavascriptEvalUtil.java:138)at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:993)... 84 moreCaused by: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "value" from undefined (<inline>#7)at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3692)at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1421)at org.mozilla.javascript.gen.c50._c1(<inline>:7)at org.mozilla.javascript.gen.c50.call(<inline>)at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)at org.mozilla.javascript.gen.c5._c0(<inline>:0)at org.mozilla.javascript.gen.c5.call(<inline>)at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)at org.mozilla.javascript.gen.c5.call(<inline>)at org.mozilla.javascript.gen.c5.exec(<inline>)at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawScript(JavascriptEvalUtil.java:99)... 86 more </pre></div><p> </p>

Comments

  • <p>Why does the script start with [color=rgb(0,136,0);]" + [/color]and ends with [color=rgb(0,136,0);]+ "[/color] ?</p>
    Warning No formatter is installed for the format ipb
  • sumathra
    edited November 8, 2013 #3
    Options
    <p> Those "+ were not deliberate, even I wonder about it's existence right here...its automatically present ...</p>
  • <p>Can you make sure that every parameter in the script exists in the report?</p><p> </p><p>Read this thread about <a data-ipb='nomediaparse' href='http://www.birt-exchange.org/forum/index.php?/topic/25630-check-existence-of-parameters/'>checking existence of parameters</a>, if your parmamters exist dynamically.</p>
    Warning No formatter is installed for the format ipb
  • sumathra
    edited November 8, 2013 #5
    Options
    <p>k,can u able to suggest me...how to this report....consider a report with a three parameter like main group,country,zone,....now  user select main group and country the table have to show data according  to parameter ...and again user select main group and zone ..the table have to  show data according  to parameter </p><p> </p><p>so for this i wrote script in before open like:</p><p> </p><p> </p><div><pre class="_prettyXprint">if (params["maingroup"].value && params["country"].value){country=this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and country_name = '" + params["country"].value + "'"+" group by COUNTRY_NAME,item_name,sub_group_name,GROUP_name"; Packages.java.lang.System.out.println ("country: " + country+"n"); }else{zone=this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and zone_name = '" + params["zone"].value + "'"+ " group by ZONE_NAME,GROUP_name,item_name,sub_group_name";Packages.java.lang.System.out.println ("zone: " + zone+"n"); }</pre></div><div> </div><div>but while run a report if a params["maingroup"].value && params["country"].value selected it showing well but if i select params["maingroup"].value && params["zone"].value its showing previous data only......its not change data according to parameter  how to correct it...</div>
  • Hello Sumatra,

    I too got same type of error on "value" if you had found any solution could you please tell me. Thanks in advance.

    Regards,
    Krishna

    @sumathra said:
    k,can u able to suggest me...how to this report....consider a report with a three parameter like main group,country,zone,....now  user select main group and country the table have to show data according  to parameter ...and again user select main group and zone ..the table have to  show data according  to parameter 

     

    so for this i wrote script in before open like:

     

     

    if (params["maingroup"].value && params["country"].value){country=this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and country_name = '" + params["country"].value + "'"+" group by COUNTRY_NAME,item_name,sub_group_name,GROUP_name"; Packages.java.lang.System.out.println ("country: " + country+"n"); }else{zone=this.queryText = this.queryText + " AND Group_name = '" + params["maingroup"].value +"'"+" and zone_name = '" + params["zone"].value + "'"+ " group by ZONE_NAME,GROUP_name,item_name,sub_group_name";Packages.java.lang.System.out.println ("zone: " + zone+"n"); }

     

    but while run a report if a params["maingroup"].value && params["country"].value selected it showing well but if i select params["maingroup"].value && params["zone"].value its showing previous data only......its not change data according to parameter  how to correct it...

    Warning No formatter is installed for the format ipb
  • jfranken
    Options

    Sai,

    I recommend that you make a copy of your report for testing, then remove parts of your code until you find the specific reference or references in the code that are generating the error. They will almost certainly end in ".value". If you don't see a syntax error, post the report to this thread if you are able. Alternatively, you can post the code. If you post the code, please provide the event handler (i.e. beforeOpen of data set) where you placed the code. It would also help to know the version of the software you are running.

    Warning No formatter is installed for the format ipb