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)
Intergrate java code in BIRT
erez
hi,
i am a new bee in BIRT, and in this forum, so i hope it is the appropriate forum section that i am using .
i build a basic BIRT report mase on MySql as data base - works ok + tomcat - as web app' - work ok.
i want to add some code in java ( since i am a JAVA programmer ).
i using eclipse + BIRT plugin + viewer - works 100%
i using BIRT book for this but i did't able to solve the following:
package my.evnt;
import org.eclipse.birt.report.engine.api.script.IReportContext;
public class TableEH extends TableEventAdapter {
/* table onPrepare event */
public void onPrepare(ITable table, IReportContext reportContext) {
try {
table.setNamedExpression("", null);
} catch (Exception e) {
}
}
}
i add the scriptapi.jar to my class path
my problem is that " table.setNamedExpression("", null); " is throw exception that the catch method can't catch it.
it is very strange, i can't understand way is that.
table.getBookmark(); - this line for example is - ok since it is not throw an exception .
but if i add an element that throw an exception , my "catch" can't handle with this .
it say " Unhandled exception type ScriptException "
Thanks in advanced for your support
Find more posts tagged with
Comments
JasonW
Have you tried to use
try{
.
.
.
table.setNamedExpression("", null);
.
.
}catch( ScriptException e){
.
}
Jason
erez
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="71732" data-time="1293471422" data-date="27 December 2010 - 10:37 AM"><p>
Have you tried to use<br />
<br />
<br />
try{<br />
.<br />
.<br />
.<br />
table.setNamedExpression("", null);<br />
.<br />
.<br />
}catch( ScriptException e){<br />
.<br />
}<br />
<br />
Jason<br /></p></blockquote>
<br />
Thanks Jason.<br />
i did as your suggest and replace my exception with the "ScriptException", but i am faceing the same problem.<br />
and there is a red circle ( with the "X") saying " No exception of type ScriptException van be thrown; an exception must be a subclass of Throwable"<br />
<br />
so... i also replace the "ScriptException " with " Throwable " - but then the error indication appear in the line above ( at table.setNamedExpression("", null); ) and ask me to surround this line in try&catch of "ScriptException " expression - , so at this point i can't understand it, beacuse ScriptException extends Throwable.<br />
<br />
<br />
Thanks for your help on this
JasonW
After you make the change I listed above make sure coreapi.jar is in the build path with the scriptapi.jar.
Jason
erez
Jason,
by adding the coreapi.jar - it appear that it working ( there is no error )... so i can start do some coding
i would like to thanks you for helping me on this problem.
Happy new year
Thanks
"Shalom"
Erez
ShlomiW
Hi all,
I know that this is an old issue, but I'm facing a very similar problem now.
Can you please post an example of how you made it to work?
Thank you
Shlomi