Tutorial 7: Changing parameter values and definitions
This tutorial provides step-by-step instructions for authoring a web page that implements the parameterValue and parameterDefinition classes to set parameter values and control the visibility of parameters in a BIRT report displayed in BIRT Viewer. You perform the following tasks:
The file in this tutorial with a hidden parameter is Sales by Territory.rptdesign.
Task 1: Create a web page that processes parameters
In this task, you open or create a copy of JSAPITemplate.html and edit its contents to display a parameter and pass the value selected by the user to a BIRT report displayed in BIRT Viewer.
1 Using a code editor, open or create a JSAPITemplate.html file that contains the essential components for any web page that implements the JSAPI.
7 In Internet Explorer, open processparameters.htm.
If you receive a security warning that Internet Explorer has restricted this page from running scripts or ActiveX controls that could access your computer, right-click on the message and select Allow Blocked Content.
8 On Please specify a territory, choose Japan, then choose Run Report. The Sales by Territory report for Japan appears, as shown in Figure 14‑7.
Figure 14‑7 Sales by Territory for Japan
Task 2: Display a hidden parameter using ParameterDefinition
In this task, you display a hidden parameter. Sales by Territory.rptdesign has two parameters, currentYear and Territory, but currentYear is a hidden parameter. To display currentYear, you use parameterDefinition to show the parameter normally.
1 Using a code editor, open processparameters.htm.
5 In Internet Explorer, open displayparameters.htm.
If you receive a security warning that Internet Explorer has restricted this page from running scripts or ActiveX controls that could access your computer, right‑click on the message and select Allow Blocked Content.
6 The currentYear parameter for Sales by Terrritory.rptdesign appears, as shown in Figure 14‑8.
Figure 14‑8 currentYear parameter displayed on a web page