Skip Headers

Oracle® Reports Tutorial 10g Release 2 (10.1.2) B14364-01 |
| Library | Product | Contents | Index

Previous | Next |

# 5 Reviewing the Source Code for the Report Block

Estimated completion time: 5 minutes

In Chapter 4, "Creating a Report Block for the Web Report", you added a report block to a JSP-based Web report. This chapter reviews the source code added for the report block.

## 5.1 Viewing the Web Source in Reports Builder

To view the Web source

- Open the Web source for the `emprev_``your initials``.jsp` report you created in Chapter 4, "Creating a Report Block for the Web Report" by double-clicking the Web Source node in the Object Navigator.

### 5.1.1 Reviewing the Header Tag and Body

1. In the Web Source view, locate the `<!-- Header -->` line.

   This HTML code indicates a comment line that helps you locate the report heading information in the file.

2. Locate the `<th>` and `<tr>` tags, which should look something like this:

       <tr>
       <th <rw:id id="HBEMPLOYEEID92" asArray="no" />
       class="OraColumnHeader">Employee Id </th>
       <th <rw:id id="HBempname92" asArray="no" /> class="OraColumnHeader"> Emp
       Name </th>
       ...

### 5.1.2 Reviewing the rw:foreach Tag and Body

The `rw:foreach` tag loops across a group. The layout is repeated for each instance of the specified group.

1. In the Web Source view, locate the `<rw:foreach>` JSP tag and find this line:

       <rw:foreach id="R_G_EMPLOYEE_ID921" src="G_EMPLOYEE_ID">

   Here, `R_G_EMPLOYEEID` is a unique identifier for this loop and`G_EMPLOYEE_ID` is the data model group on which the loop repeats.

2. Notice that the `</tbody>` tag that closes the table follows the closing `</rw:foreach>` tag, as shown here:

            <td <rw:headers id=HFDEPARTMENTID92" src...>
          </tr>
         </rw:foreach>
       </tbody>

## 5.2 Verifying Your JSP Code

If you have gone through this chapter and are still not sure whether your JSP is correct, open the file we have provided, called `empreva.jsp`. This file is located in your examples directory.

## 5.3 Summary

Congratulations! You have finished reviewing the source code for the report block you added in Chapter 4, "Creating a Report Block for the Web Report". Continue to Chapter 6, "Creating a Graph for the Web Report" to add a graph to your Web report.