Programming using the BIRT Reporting APIs : Generating reports from an application : Setting up the report engine : Configuring the BIRT home
 
Configuring the BIRT home
The BIRT home, which is the location of the BIRT plug-ins and libraries, is the key property that the report engine requires. The report engine cannot parse a report design nor render the report without a defined BIRT home. For a stand-alone application, the BIRT home is an absolute path to a file system location. For an application running from a web archive (.war) file on an application server, the BIRT home is a relative path in the WAR file. To set the BIRT home location, use one of the following techniques:
*For a stand-alone application, use one of the following techniques:
*Call EngineConfig.setBIRTHome( ) with an argument that is the path to the BIRT home directory, for example:
config.setBIRTHome( "C:/birt-runtime-<version>/ReportEngine" );
*In the application’s environment, set up the BIRT_HOME and CLASSPATH variables to access the required libraries. For example, in a Windows batch file, include commands similar to the following ones before launching the stand-alone application:
set BIRT_HOME="C:\birt-runtime-<version>\ReportEngine"
SET CLASSPATH=%BIRT_HOME%\<required library 1>;%BIRT_HOME%\<required library 2 and so on>;%CLASSPATH%
To develop an application that uses a BIRT_HOME environment variable, set BIRT_HOME in the VM arguments in the Eclipse Run dialog. For example, in VM arguments, type text similar to the following line:
-DBIRT_HOME="C:\birt-runtime-<version>\ReportEngine"
*For a deployed web application, use one of the following techniques:
*If the application has a location in the file system, use the servlet context to find the real path of the BIRT home, for example:
config.setBIRTHome( servletContext.getRealPath( "/WEB-INF" ) );
*If the application runs from a WAR file, use a relative path from the WAR file root, as shown in the following example. This configuration uses PlatformServletContext.
config.setBIRTHome( "" );
*If you use BIRT in an Eclipse-based application, such as an RCP application, and the BIRT plug-ins are located in the application’s plugins directory, you do not need to set BIRT_HOME.