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)
Question on Report # 1
nuraniuscc
Hi Mike,
When I do a "Preview" of my report, I get some errors like
Report Design (id =1)
+Unhandled exception when executing script
I believe I asked this question before. But How do I debug this message.
What I am asking is, Tell me how do I go about finding the error and fixing it
Thanks
Nurani Sivakumar
Find more posts tagged with
Comments
mwilliams
Hi Nurani,
Can you click on the '+' next to "Unhandled exception when executing script" and post the entire error? It may help a little in figuring out what's wrong.
nuraniuscc
The following items have errors:
ReportDesign (id = 1):
- Unhandled exception when executing script.
Error.UnhandledScriptError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: Unhandled exception when executing script. at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:199) at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:176) at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleInitialize(ReportScriptExecutor.java:49) at org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesign(EngineTask.java:1291) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:88) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:72) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:928) at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:876) at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:123) at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:89) at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:159) at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(BirtDocumentProcessor.java:183) at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:111) at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66) at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:225) at javax.servlet.http.HttpServlet.service(HttpServlet.java:616) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:112) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:59) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:269) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)Caused by: org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "select":ReferenceError: "select" is not defined. (/report/method[
@name="
;initialize"]#1). at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:639) at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleJSInternal(ScriptExecutor.java:60) at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleJS(ScriptExecutor.java:47) at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleInitialize(ReportScriptExecutor.java:41) ... 50 moreCaused by: org.mozilla.javascript.EcmaError: ReferenceError: "select" is not defined. (/report/method[
@name="
;initialize"]#1) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340) at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3413) at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1612) at org.mozilla.javascript.gen.c138._c0(/report/method[
@name="
;initialize"]:1) at org.mozilla.javascript.gen.c138.call(/report/method[
@name="
;initialize"]) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834) at org.mozilla.javascript.gen.c138.call(/report/method[
@name="
;initialize"]) at org.mozilla.javascript.gen.c138.exec(/report/method[
@name="
;initialize"]) at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContext.java:241) at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:635) ... 53 more
nuraniuscc
Hi Mike,
I created input parameters and when I did a "Preview" the first time the box
showed up where I could choose my parameters.
From the next time onwards, I am not getting the Report paramter box to
display, It takes the same value I entered the first time.
Qn: How can I "enable" the Input parameter window to show up every time I run the report or preview it?
Thanks
Nurani Sivakumar
mwilliams
Nurani,
Can you post the script you have in your initialize method of your report? It looks like that's where the problem in the script is, with the word "select".
In the preview window in the designer, you can click on the "Show Report Parameters" button to change the parameters. If you were using the viewer, the parameter box would always pop up for required parameters. You can see this by running the report in the web viewer rather than just in the preview screen.
nuraniuscc
Hi Mike,
First of all Where can I find this method? I don't think I created this method at all. Do I need to?
Whereever I create my report that's what you refer to as Web viewer. Right?
If so, That's what I am using. YES, I did click on "Show Parameter" Window.
But I am asking if I can have the parm window pop up without me having to
choose the "Show Parm" window.
Also, What's the difference between "Web Viewer" and the "Preview" options?
Thanks
Nurani Sivakumar
nuraniuscc
Ok Mike,
I found the "Initialize" script and removed the "SELECT". But have other errors (Which I didn't mention before) like this
Text (id = 996) & (id =604)
- An exception occurred during processing. Please see the following message for details:
Cannot get the result set metadata.
SQL statement does not return a ResultSet object.
SQL error #1: ORA-00933: SQL command not properly ended
exception.error ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: An exception occurred during processing. Please see the following message for details:Cannot get the result set metadata.SQL statement does not return a ResultSet object.SQL error #1: ORA-00933: SQL command not properly ended at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1107) at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1071) at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:88) at org.eclipse.birt.report.engine.executor.TextItemExecutor.executePlainText(TextItemExecutor.java:159) at org.eclipse.birt.report.engine.executor.TextItemExecutor.execute(TextItemExecutor.java:73) at org.eclipse.birt.report.engine.executor.ReportExecutorUtil.executeAll(ReportExecutorUtil.java:86) at org.eclipse.birt.report.engine.executor.ReportExecutorUtil.executeAll(ReportExecutorUtil.java:91) at org.eclipse.birt.report.engine.executor.ReportExecutor.createPageExecutor(ReportExecutor.java:166) at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplciateReportExecutor.createPageExecutor(SuppressDuplciateReportExecutor.java:59) at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.createPageExecutor(WrappedReportExecutor.java:48) at org.eclipse.birt.report.engine.executor.ReportExecutorUtil.executeMasterPage(ReportExecutorUtil.java:62) at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.start(HTMLPageLM.java:151) at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:89) at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:101) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:151) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:72) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:928) at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:876) at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:123) at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:89) at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:159) at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(BirtDocumentProcessor.java:183) 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.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:111) at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66) 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.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:225) at javax.servlet.http.HttpServlet.service(HttpServlet.java:616) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:112) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:59) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:269) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Error.InvalidExpressionError ( 2 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: Expression "row["BA_CONSMETHOD"]" is invalid. at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluateCondExpr(ExecutionContext.java:689) at org.eclipse.birt.report.engine.executor.ReportItemExecutor.evaluate(ReportItemExecutor.java:284) at org.eclipse.birt.report.engine.executor.StyledItemExecutor.processMappingValue(StyledItemExecutor.java:209) at org.eclipse.birt.report.engine.executor.DataItemExecutor.execute(DataItemExecutor.java:127) at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:42) at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:45) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:33) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.execute(HTMLAbstractLM.java:434) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.execute(HTMLAbstractLM.java:442) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.execute(HTMLAbstractLM.java:442) at org.eclipse.birt.report.engine.layout.html.HTMLListingBandLM.intializeHeaderContent(HTMLListingBandLM.java:96) at org.eclipse.birt.report.engine.layout.html.HTMLListingBandLM.initialize(HTMLListingBandLM.java:48) at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.initialize
mwilliams
Nurani,
It looks like there is a problem with your query on that first error.
The other error has to do with "row["BA_CONSMETHOD"]". Check for typos in the column name. Looks like this is in a report item.
Can you attach your report? I won't be able to run it, but I'll be able to check your script and everything over for errors I see.
As for the web viewer, if you go to "Run" in the toolbar and choose "View Report" and then "web viewer". This is the actual viewer that BIRT uses that you would deploy to an application server. The "preview" window is just an html preview of the report, nothing fancy.
nuraniuscc
Hi Mike,
The BA_CONSMETHOD is a valid column in the table that is being reported on.
Should the Header row that points to this column be defined as a Dynamic Text Box. Currently it's not.
Because that's what I did for the Report Parms that shows up as Header.
Just a Thought
Thanks
Nurani Sivakumar
nuraniuscc
Hi Mike,
So, If the Web viewer is the real deal and there seems to be some difference between the "Preview" and the "Web viewer" then I would rather look at the other one.
So, with that in mind, Ran the report on the Web Viewer and I get a Blank screen. Nothing (Atleast seems to) happens.
Is there anything I need to have installed etc?
Your Thoughts
Nurani Sivakumar
mwilliams
Nurani,
The only difference really is that the web viewer has page breaks. The preview is similar, only just the straight HTML representation. You don't need to have anything installed to run the web viewer from the designer. Without being able to actually run your report, I don't know why the viewer would be showing it blank.
It looks to me like the report is having a problem with the Mapping you have on the BA_CONSMETHOD item in your report right under "T3".
nuraniuscc
Hi Mike,
I fixed the BA_CONSMETHOD issue and that's gone. But I do have couple of more errors like below.
The following items have errors:
Text (id = 996):
- An exception occurred during processing. Please see the following message for details:
Cannot get the result set metadata.
SQL statement does not return a ResultSet object.
SQL error #1: ORA-00933: SQL command not properly ended
Table (id = 604):
- An exception occurred during processing. Please see the following message for details:
Cannot get the result set metadata.
SQL statement does not return a ResultSet object.
SQL error #1: ORA-00933: SQL command not properly ended
There is no specfic problem highlighted in the detailed message, upon "+"
Also I will "email" (Didn't want to post it here) my Script and you let me know if the way I have coded it is correct.
Thanks
Nurani Sivakumar
mwilliams
Nurani,<br />
<br />
I don't know if you need to do the IN clause way because you only have a single select parameter. You can probably just do the '=' way. It probably doesn't matter though.<br />
<br />
Those errors are Oracle errors. Here is a link that will take you to a site that explains the ORA-00933 error a little more.<br />
<br />
<a class='bbc_url' href='
http://ora-00933.ora-code.com/'>ORA-00933
: SQL command not properly ended</a>
nuraniuscc
Hi Mike,
So, the script (That I emailed you) looks Ok? I think the IN clause should work alright. As far as the SQL goes, I ran it in TOAD and it worked.
So, the question is " How does BIRT integrate the SQL and the Script? "
I am thinking that's where something is not right, which means then that the script is not right syntactically. (I am Guessing)
Also, I notice the ";" at the end of each line on my script. Is that right or should it be at the end of each } for an "If" statement.
Your Thoughts?
Also, I have many parameters (Refer my Script email) and I am adding a "WHERE" clause to each of them. How does BIRT know to include them but not REPEAT the Where. Something doesn't look right.
Thanks
Nurani Sivakumar
mwilliams
Nurani,
You'll probably have to set it up in a way to check each parameter and add all your parameter statements to a single string, then edit the query text with a where statement if the string is not an empty string. Finally, you'd add your group by and order by statements last. Let me know if I'm not explaining this very well.
nuraniuscc
Hi Mike,
That's a lot !!!
OK. So I need to massage the Query all into one string based on the input
parameters entered and then to that String add the GROUP BY, ORDER BY.
Give me step by step as to How to do it?
Also, How do I comment a Script or parts of it? I am getting ORA-??? (Missing Right Paranthesis)
Thanks
Nurani Sivakumar
mwilliams
Nurani,
You'll just create a string variable str = "", then as different parameters are not 'All', you'll add your parameters to this string without the word where. Then, after the last parameter is checked. You can check this varaible to see if it's still "". If not, you add the where clause with:
this.queryText = this.queryText + " where " + str + " group by... order by..."
If it is still "", you'd just have to add the group by and order by part.
nuraniuscc
So, Mike,
Where and How do I create the "str" variable. Basically, You "Build" the Query
on top of the BASE sql and then append the GROUP BY and ORDER BY.
Whew !!! That took a while to figure out.
Also, How do I shrink the gap between 2 data elements and also add a coma. For Eg; My Date shows up as " January 02 2009".
How do I format it to make it more readable etc.
My ideal output should be "January 02, 2009".
Thanks
Nurani Sivakumar
mwilliams
Nurani,
Since you're just using the str variable local right there...you can either put:
var str = "";
-OR just-
str = "";
at the top of your script there. It doesn't matter which one.
nuraniuscc
Ok, Mike,
Where do I add the word "AND" in myString variable? Where is that accounted for?
This will happen if there are multiple parameters filled in.
Also, Please respond to my other questions in my recent posts.
Thanks
Nurani Sivakumar
mwilliams
Nurani,
You'll be able to check whether the str variable is "" each time. If not, you'll need the 'and'.
Sorry...I'll have to go back and see what I haven't answered. As these threads get long with multiple questions, they get confusing.
mwilliams
If you could restate the questions I haven't answered in here or a new thread, that'd be great. You'll know quicker which ones those are. As always, new threads for new questions is always the best. Even if they're related to another question. Keeps the threads shorter and easier to look through. Thanks!
nuraniuscc
Hi Mike,
Ok, So I understand that for every parm you check the String variable and then decide to add an "and" OR not.
With that in mind, I added the following statement
if MySQLString = ""
{
.............
}
else
{
.............
}
I get an error on the "if MySQLString = "" " statement. When I hover over the
"x" mark, I see "Missing (Before condition) " .
Looks like a Syntax error
Thanks
Nurani Sivakumar
PS : I will post other pending questions shortly on a new thread
mwilliams
Nurani,
Your script would need to be:
if (MySQLString = "")
{
.....................
}
else
{
....................
}