Hi,
I am using a scripted data source to fetch data from some java objects. In the open event of the data set I am creating an instance of the service class and calling the method to fetch the data.
count=0;
loginModulesService = new Packages.UsageReportService();
loginModules = loginModulesService.getLoginsByModule();
In the fetch event I am iterating through the list and setting the values for each row.
if(count < loginModules.size()){
row["LoginType"] = loginModules.get(count).getModule();
row["LoginCount"] = loginModules.get(count).getCount();
count++;
return true;
}
return false;
In the preview results of the data set I am able to see the results but when I try and preview the report I get the following exception
Caused by: org.mozilla.javascript.EvaluatorException: missing name after . operator (/report/method[
@name="beforeRender"]#1)
at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
at org.mozilla.javascript.Parser.addError(Parser.java:146)
at org.mozilla.javascript.Parser.reportError(Parser.java:160)
at org.mozilla.javascript.Parser.memberExprTail(Parser.java:2020)
at org.mozilla.javascript.Parser.memberExpr(Parser.java:1958)
at org.mozilla.javascript.Parser.unaryExpr(Parser.java:1813)
at org.mozilla.javascript.Parser.mulExpr(Parser.java:1742)
at org.mozilla.javascript.Parser.addExpr(Parser.java:1723)
at org.mozilla.javascript.Parser.shiftExpr(Parser.java:1703)
at org.mozilla.javascript.Parser.relExpr(Parser.java:1677)
at org.mozilla.javascript.Parser.eqExpr(Parser.java:1633)
at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:1622)
at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:1611)
at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:1600)
at org.mozilla.javascript.Parser.andExpr(Parser.java:1588)
at org.mozilla.javascript.Parser.orExpr(Parser.java:1576)
at org.mozilla.javascript.Parser.condExpr(Parser.java:1559)
at org.mozilla.javascript.Parser.assignExpr(Parser.java:1544)
at org.mozilla.javascript.Parser.expr(Parser.java:1523)
at org.mozilla.javascript.Parser.statementHelper(Parser.java:1246)
at org.mozilla.javascript.Parser.statement(Parser.java:707)
at org.mozilla.javascript.Parser.parse(Parser.java:401)
at org.mozilla.javascript.Parser.parse(Parser.java:338)
at org.mozilla.javascript.Context.compileImpl(Context.java:2368)
at org.mozilla.javascript.Context.compileString(Context.java:1359)
at org.mozilla.javascript.Context.compileString(Context.java:1348)
at org.eclipse.birt.report.engine.javascript.JavascriptEngine$3.run(JavascriptEngine.java:232)
at org.eclipse.birt.report.engine.javascript.JavascriptEngine$3.run(JavascriptEngine.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.birt.report.engine.javascript.JavascriptEngine.compile(JavascriptEngine.java:228)
at org.eclipse.birt.report.engine.javascript.JavascriptEngine.compile(JavascriptEngine.java:1)
at org.eclipse.birt.core.script.ScriptContext.compile(ScriptContext.java:148)
at org.eclipse.birt.report.engine.executor.ExecutionContext.compile(ExecutionContext.java:762)
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:696)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:61)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:48)
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleBeforeRender(ReportScriptExecutor.java:128)
... 37 more
I have turned on the java debugger and notice that the java method gets called and returns. I am unable to find out the cause for the exception.
Thanks,
Prashant