Skip Headers

Oracle Reports Tutorial 10g (9.0.4) Part Number B10612-01 |
Home | Contents | Index

# 7
Reviewing the Source Code for the Graph

Estimated completion time: 5 minutes

In Chapter 6, "Creating a Graph for the Web Report", you added a graph to a JSP-based Web report. This chapter reviews the source code added for the graph.

## 7.1 View the source in Reports Builder

Open the Web Source view for the report you created in Chapter 6, "Creating a Graph for the Web Report" called `emprevb_<your initials>.jsp`.

## 7.2 Review the rw:graph Tag

The `rw:graph` tag brackets the graph information and links the graph to the data source. It also identifies the categories and the data fields.

1. In the Web Source view, locate the `<rw:graph>` JSP tag.

   The code within the `rw:graph` tag is XML.

       <rw:graph id="graph" src="G_EMPLOYEE_ID" series="EMPLOYEE_ID"
       dataValues="SALARY">

   The series tag defines the source for the values along the X-axis, and the dataValues tag defines the source for the data along the Y-axis. You defined these parameters in the Graph Wizard in Chapter 6.

2. Locate the `<SeriesItems>` tag below the rw:graph tag:

       <SeriesItems>
       <Series id="0" color="#cc66cc"/>
       </SeriesItems>

   This tag represents the modification to the Row 1 color we made in the Graph Wizard in Chapter 6. If you chose a different color, you will see a different value for the color tag.

3. Here, you can see that the color value `#cc66cc` is applied to the first bar along the x-axis:

#### Figure 7-1 Graph with Color on first row

Text description of the illustration graph_rvw.gif

1. Locate the `<Title>` tag, located here:

       </SeriesItems>
       <Title visible="true" text="Employees by Salary"/>

This tag adds the graph title to your Web report, shown here:

#### Figure 7-2 Graph with Title

Text description of the illustration graph_rvw_title.gif

1. Locate the `</rw:graph>` JSP tag, located here:

       </Graph>

       -->
       </rw:graph></p>
         <p></p>
       ...

The XML that produces the graph is closed before the `</rw:graph>` JSP tag is closed.

Note: The Graph Wizard is re-entrant. So, if you'd like to modify your graph, you can always move your cursor into the XML between the rw:graph tags, then choose Edit > Selection. The Graph Wizard displays with the options you chose in Chapter 6.

## 7.3 Summary

Congratulations! You have finished reviewing the source code for your new graph. For more information on creating Web reports, adding report blocks and data, and creating graphs, see the Reports Builder online help.

| Copyright © 2002, 2003 Oracle Corporation. All Rights Reserved. |
Home | Contents | Index