IBM Books

Net.Data Reference Guide

REPORT Block

Purpose

The REPORT block formats the output from a function call. It can have a table name as a parameter. If a table name is specified, the report is generated using the data in the specified table. Otherwise, the report is generated using the first output table found in the function parameter list, or if no table exists in the parameter list, the default table data is used.

Syntax

>>-%report---+-------------+------------------------------------>
             +-(--name--)--+
 
      +--------------------------+                +--------------------------+
      V                          |                V                          |
>--{----+-----------------------++--+-----------+---+-----------------------++--%}--><
        +-string----------------+   +-row block-+   +-string----------------+
        +-HTML if block---------+                   +-HTML if block---------+
        +-variable reference----+                   +-variable reference----+
        +-function call---------+                   +-function call---------+
        +-HTML statements-------+                   +-HTML statements-------+
        +-include statement-----+                   +-include statement-----+
        +-include_url statement-+                   +-include_url statement-+
 

Parameters

%report

The keyword for specifying formatting instructions for the output of a function call. You can use header and footer information for the report.

name

An alphabetic or numeric string beginning with an alphabetic character or underscore and containing any combination of alphabetic, numeric, or underscore characters.

string

Any sequence of alphabetic and numeric characters and punctuation except a tabulator, new line character, or a space.

variable reference

Returns the value of a previously defined variable and is specified with $ and (). For example: if VAR = 'abc', then $(VAR) returns the value 'abc'. See Variable Reference for syntax information.

function call

Invokes one or more previously defined FUNCTION blocks with specified arguments. See Function call (@) for syntax and examples. The REPORT block cannot include function calls that are SQL function calls, except on the OS/400 platform.

HTML if block

The HTML IF block used in the HTML part of the Net.Data macro. Performs conditional string processing. Numeric values are treated as strings for comparisons. See HTML IF Statement for syntax and examples.

HTML statements

Includes any alphabetic or numeric characters, and HTML tags to be formatted for the client's browser.

include statement

The INCLUDE statement. Reads and incorporates a file into the Net.Data macro. See INCLUDE Statement for syntax and examples.

include_url statement

The INCLUDE_URL statement. Reads and incorporates another file into the Net.Data macro where the statement is specified. The specified file can exist on a local or remote server. See INCLUDE_URL Statement for syntax and examples.

row block

The ROW block. Displays HTML formatted data once for each row of data returned from a function call. See ROW Block for syntax and examples.

Context

Can be found in these contexts:

Restrictions

Can contain these elements:

Examples

Example 1: A 2-column HTML table show a list of names and locations. Selecting a name in the table calls the details HTML block of the name.mac Net.Data macro and sends it the two values as part of the URL. In this example, the values can be used in name.mac to look up additional details about the name.

%REPORT{
<H2>Query Results</H2>
<P>Select a name for details.
<TABLE BORDER=1>
<TR><TD>Name</TD><TD>Location</TD>
%ROW{
<TR>
<TD>
<a href="/cgi-bin/db2www/name.mac/details?name=$(V1)&location=$(V2)">$(V1)</a></TD>
<TD>$(V2)</TD>
%}
</TABLE>
%}


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]