AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | PTX | SUN | Win NT |
X | X | X | X | X | X | X | X | X |
Purpose
A table variable whose value Net.Data increments each time a row is processed in a Net.Data table. The variable acts as a counter and its value is the number of the current row being processed.
RPT_MAX_ROWS can affect the value of ROW_NUM. For example, if 100 rows are in a table, and you have set RPT_MAX_ROWS to 20, the final value of ROW_NUM is 20, because row 20 was the last row processed.
You can reference ROW_NUM only from within a ROW block.
Examples
Example 1: Populates a column in the HTML output by using ROW_NUM to label each row in the table
%REPORT{ <table border=1> <tr><td> Row Number </td> <td> Customer </td> %ROW{ <tr><td> $(ROW_NUM) </td> <td> $(V_custname) </td> %} </table> %}
The REPORT block produces a table like the one shown below.
Row Number | Customer |
---|---|
1 | Jane Smith |
2 | Jon Chiu |
3 | Frank Nguyen |
4 | Mary Nichols |