A script-enabled browser is required for this page to function properly.

<rw:headers>

The rw:headers tag works in conjunction with the rw:id tag. It was designed for situations, such as matrix reports, where matrix cells and cross labels are in different rw:foreach tag bodies. These Java script variables created by the cross labels' rw:id tag are then no longer valid when the cells are displayed. To solve this problem, the asArray attribute of the rw:id tag can be set to yes and you can use PageContext to save the id object, while using the rw:headers tag to retrieve the id values. The id object contains an array of id values, and an array index pointing to the current id in array. This array is the value of rw:headers's src attribute.

Syntax

<rw:headers id="headers_id" src="rw:id_attributes" />

Attribute Value

Description

headers_id

A unique identifier in the page scope.

rw:id_attributes

A list of the rw:id tag's id attribute values separated by commas (,). The values are used to get id objects from the page context. An id value is extracted from each id object. The id value pointed to by the array index is retrieved from the id object's id array , and the array index is increased by 1, pointing to the next value. If the array index is already at its last value, it is reset to 0, pointing to the first value. It is assumed that you always retrieve id values from an id object starting at the first item and finishing at the last item of the id array.

Example

This example shows a matrix report JSP source, using the rw:id tag with the rw:id tag's asArray attribute set to yes.

<table>
<!-- header: dept -->
<tr>
  <rw:foreach id="fe_dept1" src="G_dept">
    <rw:foreach id="fe_job1" src="G_job">
      <td <rw:id id="dept" breakLevel="fe_dept1" asArray="yes"/>>
          <rw:field src="deptno" breakLevel="fe_dept1"/>
      </td>
    </rw:foreach>
  </rw:foreach>
</tr>

<!-- header: job -->
<tr>
  <rw:foreach id="fe_dept2" src="G_dept">
    <rw:foreach id="fe_job2" src="G_job">
      <td <rw:id id="job" asArray="yes"/> <rw:headers id="dept"/>>
        <rw:field src="job"/>
      </td>
    </rw:foreach>
  </rw:foreach>
</tr>

<rw:foreach id="fe_region" src="g_region">
  <rw:foreach id="fe_office" src="g_office">
    <tr>
      <!-- header: region -->
      <td <rw:id id="region" breakLevel="fe_region">>
          <rw:field src="region" breakLevel="fe_region">
      </td>

      <!-- header: office -->
      <td <rw:id id="office">>
        <rw:field src="office">
      </td>

      <!-- cells -->
      <rw:foreach id="fe_dept3" src="G_dept">
        <rw:foreach id="fe_job3" src="G_job">
          <td <rw:headers id="cellheaders" src="region,office,dept,job"/>>
             <rw:field src="sumSal">
          </td>
        </rw:foreach>
      </rw:foreach>
    </tr>
  </rw:foreach>
</rw:foreach>

</table>

See also

Custom JSP tags for Oracle Reports

About JSP tags

About JavaServer Pages and servlets