Before you can create reports with EGL and Jasper, you
must add support for Jasper reports to your project and add a Java™ compiler to your system's path
variable.
Adding Jasper report support adds JAR files to your project that
enable EGL to compile report design files. You only need to do this
once for each project that uses Jasper reports, and there is no need
to remove support from a project.
You can add support for Jasper reports only to EGL projects, not
to EGL web projects.
- In the Project Explorer view, right-click your EGL project and
then click Properties. The Properties window
opens.
- In the Properties window, click EGL Project Features.
- Under EGL Project Features at the right side of the window, select
the EGL with Jasper report support check box.
If this check box is already selected, leave it selected.
- Click OK.
Alternately, you can enable Jasper report support in a new project.
Select the EGL with Jasper report support check
box in the New EGL Project wizard. Selecting this check box has the
same effect as selecting the check box in the Properties window.
Adding the Java compiler
to the PATH environment variable
To compile
a report design file, EGL needs a Java compiler
in your system's PATH environment variable.
Use
a Java compiler with the same
version as the version of Java you
are using to generate EGL. Follow these steps to tell what level of Java you are using:
- Right-click an EGL project and then click Properties.
- In the Properties window, click Java Compiler.
This
page shows settings for the project's Java compiler.
By default, the Enable project specific settings check
box is cleared and the rest of the fields on the page are disabled.
- If the Enable project specific settings check
box is selected, the version of Java that
you are using in this project is shown in the Compiler
compliance level field.
- If the Enable project specific settings check
box is cleared, click Configure Workspace Settings.
The Preferences window opens to the Compiler page, and the version
of Java you are using for all
your projects is shown in the Compiler compliance level field.
Follow these steps to add the Java compiler to your system:
- Obtain and install a Java SDK
if you do not already have one. IBM® offers
a Java SDK for download at the
following website: http://www.ibm.com/developerworks/java/jdk/.
- In your system's PATH environment variable, add
the location of the Java SDK.
See your operating system documentation for instructions.
Adding support for PDF reports
If you want
to export reports in Portable Document Format (PDF), follow these
additional steps after adding support for Jasper reports:
- Download the file iText-1.3.jar from the following website:http://prdownloads.sourceforge.net/itext.
- In the Project Explorer view, right-click your project and then
click Properties.
- In the Properties window, click Java Build Path.
- On the Libraries tab, click Add
External JARs.
- In the JAR Selection window, select the iText-1.3.jar file that
you just downloaded and click Open.
Now the
iText-1.3.jar file is listed under JARs and class folders
on the build path.
- Click OK.
Setting the export location for reports in RCP mode
If
you are creating reports in a Console UI application that is running
in rich client platform (RCP) mode, you must set the osgi.user.area system
property to the location where you want to store reports. Otherwise,
reports will be created in the product installation directory.
- Click . The Run window opens.
- From the list of runtime configurations, expand Eclipse
Application and then click the run configuration for the
program.
- On the Arguments tab of the run configuration,
add the following code:
-user "<location>"
In
place of <location>, use the directory
to which you want to generate the reports.
- Click Apply to save changes to the run
configuration.