Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
CLOB passing
padytom
<p>Trying to pass a 'Fail' and 'pass' from longdescription (CLOB)</p>
<p> </p>
<p>this</p>
<p>if ("fail" in { Longdescription.ldtext}) then "failed" else "passed"</p>
<p> </p>
<p>is passing in crystal reports.Same syntax in Birt which is</p>
<p> </p>
<p>if ('FAIL' in row["LDTEXT"]) {'FAILED'} else {'PASSED'} is giving errors.</p>
<p> </p>
<p>Any help?</p>
Find more posts tagged with
Comments
JFreeman
<p>What are the specific errors you are receiving?</p>
<p> </p>
<p>Do you have a sample report you can provide that replicates the issue?</p>
padytom
<p>These are attachments</p>
JFreeman
<p>Instead of using the preview tab, could you run the report by select Run -> View Report -> In Web Viewer.</p>
<p> </p>
<p>After the error occurs, could you please provide the full error text received within the Error Log and Web Viewer?</p>
<p> </p>
<p>The 17070 error is a generic failure and the error log should have the full error text and stack trace.</p>
padytom
<p>org.eclipse.birt.data.engine.core.DataException: Fail to compute value for computed column "Time".<br>
A BIRT exception occurred. See next exception for more information.<br>
There are errors evaluating script "if ('FAIL' in row["LDTEXT"]) {'FAILED'} else {'PASSED'}":<br>
TypeError: Can't use instanceof on a non-object.</p>
<p> at org.eclipse.birt.data.engine.impl.ComputedColumnHelper$ComputedColumnHelperInstance.process(ComputedColumnHelper.java:532)</p>
<p> at org.eclipse.birt.data.engine.impl.ComputedColumnHelper.process(ComputedColumnHelper.java:137)</p>
<p> at org.eclipse.birt.data.engine.executor.cache.RowResultSet.processFetchEvent(RowResultSet.java:173)</p>
<p> at org.eclipse.birt.data.engine.executor.cache.RowResultSet.doNext(RowResultSet.java:126)</p>
<p> at org.eclipse.birt.data.engine.executor.cache.RowResultSet.next(RowResultSet.java:96)</p>
<p> at org.eclipse.birt.data.engine.executor.transform.SimpleResultSet$RowResultSetWithResultSetScope.fetch(SimpleResultSet.java:940)</p>
<p> at org.eclipse.birt.data.engine.executor.cache.RowResultSet.doNext(RowResultSet.java:118)</p>
<p> at org.eclipse.birt.data.engine.executor.cache.RowResultSet.next(RowResultSet.java:96)</p>
<p> at org.eclipse.birt.data.engine.executor.transform.SimpleResultSet.prepareFirstRow(SimpleResultSet.java:309)</p>
<p> at org.eclipse.birt.data.engine.executor.transform.SimpleResultSet.getResultSetIterator(SimpleResultSet.java:328)</p>
<p> at org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:1026)</p>
<p> at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:415)</p>
<p> at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:1167)</p>
<p> at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:232)</p>
<p> at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:178)</p>
<p> at org.eclipse.birt.report.engine.api.impl.ExtractionResults.nextResultIterator(ExtractionResults.java:157)</p>
<p> at org.eclipse.birt.report.designer.data.ui.dataset.DataSetPreviewer.preview(DataSetPreviewer.java:69)</p>
<p> at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage$5.run(ResultSetPreviewPage.java:338)</p>
<p> at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)</p>
<p>Caused by: org.eclipse.birt.data.engine.core.DataException: A BIRT exception occurred. See next exception for more information.<br>
There are errors evaluating script "if ('FAIL' in row["LDTEXT"]) {'FAILED'} else {'PASSED'}":<br>
TypeError: Can't use instanceof on a non-object.</p>
<p> at org.eclipse.birt.data.engine.core.DataException.wrap(DataException.java:123)</p>
<p> at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evalExpr(ScriptEvalUtil.java:946)</p>
<p> at org.eclipse.birt.data.engine.impl.ComputedColumnHelper$ComputedColumnHelperInstance.process(ComputedColumnHelper.java:493)</p>
<p> ... 18 more</p>
<p>Caused by: org.eclipse.birt.core.exception.CoreException: There are errors evaluating script "if ('FAIL' in row["LDTEXT"]) {'FAILED'} else {'PASSED'}":<br>
TypeError: Can't use instanceof on a non-object.</p>
<p> at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295)</p>
<p> at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)</p>
<p> at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evalExpr(ScriptEvalUtil.java:918)</p>
<p> ... 19 more</p>
<p>Caused by: org.mozilla.javascript.EcmaError: TypeError: Can't use instanceof on a non-object.</p>
<p> at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)</p>
<p> at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)</p>
<p> at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)</p>
<p> at org.mozilla.javascript.ScriptRuntime.typeError0(ScriptRuntime.java:3666)</p>
<p> at org.mozilla.javascript.ScriptRuntime.in(ScriptRuntime.java:2972)</p>
<p> at org.mozilla.javascript.gen.c958._c0(unnamed script:0)</p>
<p> at org.mozilla.javascript.gen.c958.call(unnamed script)</p>
<p> at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)</p>
<p> at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)</p>
<p> at org.mozilla.javascript.gen.c958.call(unnamed script)</p>
<p> at org.mozilla.javascript.gen.c958.exec(unnamed script)</p>
<p> at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)</p>
<p> ... 21 more</p>
JFreeman
<p>Thank you for the error text.</p>
<p> </p>
<p>Instead of using in, you can use indexOf to achieve the same result.</p>
<p> </p>
<p>For Example:</p>
<pre class="_prettyXprint _lang-js">
if(row["LDTEXT"].indexOf("FAIL") > -1){
"FAILED";
}else{
"PASSED";
}
</pre>
padytom
<p><sub><span style="font-size:12px;"><span style="font-size:14px;">Thank you for the suggestion. It also gives error</span></span></sub></p>
JFreeman
<p>Try encapsulating the code in a null check:</p>
<pre class="_prettyXprint _lang-js">
if(row["LDTEXT"]){
if(row["LDTEXT"].indexOf("FAIL") > -1){
"FAILED";
}else{
"PASSED";
}
}
</pre>
padytom
<p>Please how do I do that? I'm new to many things</p>
JFreeman
<p>The code from my previous post includes the null check.</p>
<p> </p>
<p>Alternatively, you can also check for null like this to make it a bit more typed out:</p>
<pre class="_prettyXprint _lang-js">
if(row["LDTEXT"] != null){
if(row["LDTEXT"].indexOf("FAIL") > -1){
"FAILED";
}else{
"PASSED";
}
}
</pre>
padytom
<p>Thank you for your support. Been able to solve that problem.</p>
JFreeman
<p>Thank you for the confirmation.</p>
<p>I am glad to hear the issue has been resolved.</p>