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

<rw:field>

The rw:field tag takes as its source any single value source object in the data model and provides formatting functionality to render the object in HTML. Examples of these single value source objects are: columns, user parameters, PL/SQL scripts, functions, command line keywords, and system parameters.

An rw:field for a column within a group must be in the body of the rw:foreach tag whose src attribute points to the group to which the column belongs. For each field in rw:field it will first be checked whether it belongs to a group of enclosing rw:foreach tags, starting from the inner most rw:foreach tag. If that is not the case, a check is done to see if the field is a report-level field.

Note: A matrix group cannot be referenced by the breakLevel attribute.

Syntax

<rw:field id="field_id" src="object_name" [breakLevel="level"] 
   [breakValue="break_value"] [nullValue="null_value"] [containsHtml="HTML_value"] 
   [formatMask="format_mask"] [formatTrigger="format_trigger"] [urlEncode="encode_value"] >
   [tag body]
</rw:field>

Attribute Value

Description

field_id

A unique identifier in the page scope.

object_name

Name of the referenced Reports object, such as a column, system parameter, or command line keyword.

level

(Optional) The frequency at which the field is to be repeated. It is the name of the enclosing rw:foreach tag.

break_value

(Optional) The string value that is to be used when the field does not repeat at a specified breakLevel. The default value is &nbsp;.

null_value

(Optional) The value that is to be used when the field's value is null. The default value is &nbsp;.

HTML_value

(Optional) Can be either of the following:

  • yes: The field's value includes HTML.

  • no: (default) The field's value does not include HTML. HTML reserved characters are converted to their HTML character entities (for example, < is converted to &lt;)

format_mask

(Optional) The format mask that is applied to the field value. It only applies to fields with number or date data types.

format_trigger

(Optional) The name of a format trigger program unit. The executing program unit sets the field's attributes in the Reports backend structure. The tag handler will pick up those attributes and convert them to HTML. If format trigger returns false, there will be no output. The format trigger overrides any settings from tag attributes.

  • The format trigger program unit can use the following SRW packaged functions and procedures to set column attributes:

    set_format_mask, set_hyperlink, set_linkage, set_text_color, set_justification, set_font_face, set_font_style, set_font_size, set_font_weight, set_display_name, set_field_char, set_field_date and set_field_num.

  • The following SRW packaged functions and procedures are not supported in the format trigger:

    set_background_border_color, set_background_fill_color, set_foreground_border_color, set_foreground_fill_color, set_border_pattern, set_border_width, set_fill_pattern and set_bookmark

encode_value

(Optional) Can be either of the following:

  • yes: The field's value includes HTML, and requires a URL encode to be performed on the value before printing it. For example, this is required if you want to dynamically create a URL.

  • no: (default) The field's value does not include HTML. HTML reserved characters are converted to their HTML character entities (for example, < is converted to &lt;).

Examples

Example 1

This example shows a simple use of a rw:field tag.

<rw:field id="F_SumSALARYPerReport" src="SumSALARYPerReport">    
  F_SumSALARYPerReport 
</rw:field>

Example 2

This example shows the use of rw:field inside a rw:foreach loop.

<rw:foreach id="R_G_EMP_NAME_1" src="G_EMP_NAME">
   <tr bgcolor="<rw:seqval ref="bgcolor" op="nextval"/>">
      <td headers="<%= idEmpName %>"> 
        <rw:getValue id="myEmpName" src="EMP_NAME"/><%= myEmpName %></td> 
      <td headers="<%= idEmpId %>"> 
        <rw:field id="F_EMPLOYEE_ID" src="EMPLOYEE_ID"> F_EMPLOYEE_ID </rw:field></td>
      <td headers="<%= idHireDate %>"> 
        <rw:field id="F_HIRE_DATE" src="HIRE_DATE"> F_HIRE_DATE </rw:field></td>
      <td headers="<%= idSalary %>"> 
        <rw:field id="F_SALARY" src="SALARY"> F_SALARY </rw:field></td>    
      <td headers="<%= idCommision %>"> 
        <rw:field id="F_COMM_PCT" src="COMMISSION_PCT"> F_COMM_PCT </rw:field></td> 
      <td headers="<%= idManager %>"> 
        <rw:field id="F_EMPLOYEE_ID1" src="EMPLOYEE_ID1"> F_EMPLOYEE_ID </rw:field></td>
      <td headers="<%= idTotal %>"> 
        <rw:field id="F_TotalSALARY" src="TotalSALARYPerEMPLOYEE_ID"    
         formatMask="%NNNNN.00"> F_TotalSALARY </rw:field></td>
   </tr>
</rw:foreach>

Example 3

In prior releases, Reports Builder introduced Web links that you can add to paper-based reports, which become active when you display your paper report in a Web browser or PDF viewer. For JSP-based Web reports, hyperlinks have to be created manually, and if the hyperlinks need to substitute data values, the data values must be provided with the rw:field tag. For example:

<a href="http://server/path/rwservlet?report=department.jsp&p_deptno=<rw:field id="F_Deptno" src="Deptno"/>">
<rw:field id="F_Deptno" src="Deptno">10</rw:field>
</a>

See also

Oracle Reports JSP tags

About JSP tags

About JavaServer Pages and servlets