Contents

Introduction

BIRT uses an Application Context Map to store values and object for use in all phases of report generation and presentation.
Objects in the Application Context can be referenced from Script, the Expression Builder, in the ODA layer, etc. Modifying the Application Context can be done using the APIs. It can also be done using the Web Viewer.
This example demonstrates adding an Object to the Application Context for the Viewer.

BIRT Version Compatibility

This example was built and tested with BIRT 2.2 M6.

Example Files

Description

To add a specific object to the Application Context for use within the viewer requires that you set some request attributes before calling the viewer. Specifically these are the AppContextKey adn AppContextValue attributes. The AppContextKey is the name that will be used to reference the object within the report. The AppContextValue will be the object that gets added. Presented below is an example JSP page that adds these attributes to the session. Notice we are just using a String object, but this could be any object in your application.