Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Servlet Example

Servlet Example

This example demonstrates using the RE API within a servlet. Note if possible it is better to use the BIRT Web Viewer Example. Add comments at the bottom of the example.

BIRT Report Engine API Return to the BIRT Report Engine API examples

Setup

1. Create a WebReport/WEB-INF/lib directory underneath the Tomcat webapps directory.

2. Copy all the jars in the birt-runtime-2_1_0/ReportEngine/lib directory from the Report Engine download into your WebReport/WEB-INF/lib directory.

3. Create a directory named platform in your WEB-INF folder.

4. Copy the birt-runtime-2_1_0/Report Engine/plugins and birt-runtime-2_1_0/ReportEngine/configuration directories to the platform directory you just created.

Document1 01.png
This example application consist of three files that are archived into webreport.jar. If you are using Eclipse to build the servlet make sure to add all the jars, from the birt-runtime-2_1_0/ReportEngine/lib directory to your build path. You will also need servlet.jar, from the Tomcat Eclipse plug-in in your build path. Either build or copy webreport.jar from the example and place it in your WEB-INF/lib directory.

  • BirtConfig.properties - Configuration properties for the Engine.
  • BirtEngine.java - Class used to initialize the Report Engine.
  • WebReport.java - The servlet that handles report generation on a GET command.


Source

Copyright © Eclipse Foundation, Inc. All Rights Reserved.