<p>Hi,</p>
<p>I have been looking at the example on how to highlight duplicate values in a report as <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/1054-highlight-duplicates-in-a-table/'>described in this article</a>. However, when I try to run the report, the initial data is generated, but then i get an error message below the results saying that the variable "first" is invalid (see attached screenshot):</p>
<p> </p>
<div><em><span style="font-size:12px;">ReportDesign (id = 1): </span></em></div>
<div> </div>
<div><em><span style="font-size:12px;">+ Expression "var array = reportContext.getPersistentGlobalVariable("array");</span></em></div>
<div><em><span style="font-size:12px;">var first = array.indexOf(row["DUPLICATES"]);</span></em></div>
<div><em><span style="font-size:12px;">first;" is invalid. </span></em></div>
<div> </div>
<div><span style="font-size:14px;">The full error when expanded is:</span></div>
<div> </div>
<div>
<div><em><span style="font-size:12px;">ReportDesign (id = 1): </span></em></div>
<div> </div>
<div><em><span style="font-size:12px;">- Expression "var array = reportContext.getPersistentGlobalVariable("array");</span></em></div>
<div><em><span style="font-size:12px;">var first = array.indexOf(row["DUPLICATES"]);</span></em></div>
<div><em><span style="font-size:12px;">first;" is invalid. Error.InvalidExpressionError ( 2 time(s) )</span></em></div>
<div><em><span style="font-size:12px;">detail : org.eclipse.birt.report.engine.api.EngineException: Expression "var array = reportContext.getPersistentGlobalVariable("array");</span></em></div>
<div><em><span style="font-size:12px;">var first = array.indexOf(row["DUPLICATES"]);</span></em></div>
<div><em><span style="font-size:12px;">first;" is invalid. </span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluateCondExpr(ExecutionContext.java:775)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:680)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.executor.ReportItemExecutor.evaluateBoolean(ReportItemExecutor.java:309)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.executor.StyledItemExecutor.createHighlightStyle(StyledItemExecutor.java:169)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.executor.StyledItemExecutor.processStyle(StyledItemExecutor.java:74)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.executor.DataItemExecutor.execute(DataItemExecutor.java:81)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:160)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:67)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:132)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:170)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:75)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.service.birt.BirtReportProviderImpl.execute(BirtReportProviderImpl.java:324)</span></em></div>
<div><em><span style="font-size:12px;">at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</span></em></div>
<div><em><span style="font-size:12px;">at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)</span></em></div>
<div><em><span style="font-size:12px;">at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</span></em></div>
<div><em><span style="font-size:12px;">at java.lang.reflect.Method.invoke(Method.java:601)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.service.birt.PrivilegedBirtReportProvider$Handler$1.run(PrivilegedBirtReportProvider.java:171)</span></em></div>
<div><em><span style="font-size:12px;">at java.security.AccessController.doPrivileged(Native Method)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.service.birt.PrivilegedBirtReportProvider$Handler.invoke(PrivilegedBirtReportProvider.java:179)</span></em></div>
<div><em><span style="font-size:12px;">at com.sun.proxy.$Proxy416.execute(Unknown Source)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.service.birt.PrivilegedBirtReportProvider.execute(PrivilegedBirtReportProvider.java:106)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.service.impl.MultiVendorReportProvider.execute(MultiVendorReportProvider.java:40)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.service.impl.ReportExecutorImpl$ReportSharableLockWork.run(ReportExecutorImpl.java:176)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.sharablelock.impl.SharableLockManagerImpl.performLockWork(SharableLockManagerImpl.java:52)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.sharablelock.impl.SharableLockManagerImpl.performSharedLockWork(SharableLockManagerImpl.java:33)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.service.impl.ReportExecutorImpl.execute(ReportExecutorImpl.java:61)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.service.impl.ReportExecutorImpl.execute(ReportExecutorImpl.java:49)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.web.struts.RunReportAction$ReportExecutionTask.call(RunReportAction.java:422)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.reporting.web.struts.RunReportAction$ReportExecutionTask.call(RunReportAction.java:398)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.util.ThreadUtil$1.run(ThreadUtil.java:59)</span></em></div>
<div><em><span style="font-size:12px;">at java.security.AccessController.doPrivileged(Native Method)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.util.ThreadUtil.callWithContextClassLoader(ThreadUtil.java:51)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.servlet.processing.impl.LongRunningTaskThreadPoolServiceImpl$ContextPreservingCallable$1.run(LongRunningTaskThreadPoolServiceImpl.java:266)</span></em></div>
<div><em><span style="font-size:12px;">at java.security.AccessController.doPrivileged(Native Method)</span></em></div>
<div><em><span style="font-size:12px;">at blackboard.platform.servlet.processing.impl.LongRunningTaskThreadPoolServiceImpl$ContextPreservingCallable.call(LongRunningTaskThreadPoolServiceImpl.java:261)</span></em></div>
<div><em><span style="font-size:12px;">at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)</span></em></div>
<div><em><span style="font-size:12px;">at java.util.concurrent.FutureTask.run(FutureTask.java:166)</span></em></div>
<div><em><span style="font-size:12px;">at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)</span></em></div>
<div><em><span style="font-size:12px;">at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)</span></em></div>
<div><em><span style="font-size:12px;">at java.lang.Thread.run(Thread.java:722)</span></em></div>
<div><em><span style="font-size:12px;">Caused by: org.eclipse.birt.data.engine.core.DataException: A BIRT exception occurred: Error evaluating Javascript expression. Script engine error: TypeError: Cannot call method "indexOf" of null (#1)</span></em></div>
<div><em><span style="font-size:12px;"> Script source: , line: 0, text:</span></em></div>
<div><em><span style="font-size:12px;">var array = reportContext.getPersistentGlobalVariable("array");</span></em></div>
<div><em><span style="font-size:12px;">var first = array.indexOf(row["DUPLICATES"]);</span></em></div>
<div><em><span style="font-size:12px;">first;. See next exception for more information.</span></em></div>
<div><em><span style="font-size:12px;">Error evaluating Javascript expression. Script engine error: TypeError: Cannot call method "indexOf" of null (#1)</span></em></div>
<div><em><span style="font-size:12px;"> Script source: , line: 0, text:</span></em></div>
<div><em><span style="font-size:12px;">var array = reportContext.getPersistentGlobalVariable("array");</span></em></div>
<div><em><span style="font-size:12px;">var first = array.indexOf(row["DUPLICATES"]);</span></em></div>
<div><em><span style="font-size:12px;">first;</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.data.engine.core.DataException.wrap(DataException.java:118)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:773)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evalExpr(ScriptEvalUtil.java:720)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evalExpr(ScriptEvalUtil.java:661)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluateCondExpr(ExecutionContext.java:770)</span></em></div>
<div><em><span style="font-size:12px;">... 57 more</span></em></div>
<div><em><span style="font-size:12px;">Caused by: org.eclipse.birt.core.exception.CoreException: Error evaluating Javascript expression. Script engine error: TypeError: Cannot call method "indexOf" of null (#1)</span></em></div>
<div><em><span style="font-size:12px;"> Script source: , line: 0, text:</span></em></div>
<div><em><span style="font-size:12px;">var array = reportContext.getPersistentGlobalVariable("array");</span></em></div>
<div><em><span style="font-size:12px;">var first = array.indexOf(row["DUPLICATES"]);</span></em></div>
<div><em><span style="font-size:12px;">first;</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoException(JavascriptEvalUtil.java:299)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawScript(JavascriptEvalUtil.java:102)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScript(JavascriptEvalUtil.java:134)</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:769)</span></em></div>
<div><em><span style="font-size:12px;">... 60 more</span></em></div>
<div><em><span style="font-size:12px;">Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "indexOf" of null (#1)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3557)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3535)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3563)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3582)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3601)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2160)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.gen.c14._c0(:1)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.gen.c14.call()</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003)</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.gen.c14.call()</span></em></div>
<div><em><span style="font-size:12px;">at org.mozilla.javascript.gen.c14.exec()</span></em></div>
<div><em><span style="font-size:12px;">at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawScript(JavascriptEvalUtil.java:95)</span></em></div>
<div><em><span style="font-size:12px;">... 62 more</span></em></div>
<div> </div>
</div>
<div>The report should highlight the rows where the values in computed column <em>DUPLICATES </em>have dulpicate values.</div>
<div>I am using Birt 3.2.17 as this is the version required for use with Blackboard Learn. I have also attached the .rptdesign file if it is any help.</div>
<div> </div>
<div>Any advice that you could give would be great. I've wrestled with this for a couple of days now.</div>
<div> </div>
<div>Kind regards,</div>
<div>Joe</div>