<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.
<rw:headers id="headers_id" src="rw:id_attributes" />
Attribute Value |
Description |
|
A unique identifier in the page scope. |
rw:id_attributes |
A list of the |
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>
Custom JSP tags for Oracle Reports
About JavaServer Pages and servlets
Copyright © 1984, 2005, Oracle. All rights reserved.