Wednesday, April 28, 2010

BIRT Eclipse Loading Classes Event Handler

If you are having issues loading a class using the BIRT reporting tool, it might be because you are putting the class in the wrong location. BIRT is very directory specific and you have to make sure you put the scripts in the correct locations.

For example, if you are trying to run a report that uses an event handler or any other Java class, you need to put the jar files in this location: org.eclipse.birt.report.viewer_2.5.2.v20091210\birt\scriptlib.

What you will first do is to create a Java project and create the class that you want to use.

You then will create a jar file and put it in the scriptlib directory. You will need to restart Eclipse.

You will create a report project and create your report.

You will want to select properties on your report project and add the Java workspace as a project reference.

You will also need to make sure that you have configured BIRT to locate your scriptlib directory. I noticed that the default is empty and it doesn't seem to find the directory when it is empty.

Locate the BIRT web.xml file in the WEB-INF directory and make sure the BIRT scriptlib directory is set like this:

<context-param>
<param-name>BIRT_VIEWER_SCRIPTLIB_DIR</param-name>
<param-value>${birt.viewer.working.path}/scriptlib</param-value>
</context-param>

Restart Eclipse and run your report and it should work.

0 comments: