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
Context
Can be found in these contexts:
Restrictions
Can contain these elements:
Exception: SQL functions cannot be called from inside SQL functions.
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>
%}