These variables help you customize your reports. You must define these variables before using them.
Purpose
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
This variable controls leading and trailing spaces used with the report variables NLIST and VLIST. The default is no leading or trailing spaces, which is useful in imbedding query results in HTML anchors or form action. If this variable is set to yes, the report variables are padded with spaces so they align properly when outputting a report.
Alternatively, you can specify the space as a separator for these variables in a LIST statement, as shown in Example 2.
Examples
Example 1: Because ALIGN is set to YES, each column in the list is separated by a space.
%DEFINE ALIGN="YES" <P>Your query was on these columns: $(NLIST)
Example 2: The output from this example is the same as Example 1, but the separator is indicated in a LIST statement. See "List Variables" for more information.
%DEFINE %LIST " " NLIST
%REPORT{
<P>Your query was on these columns: $(NLIST)
%}
Purpose
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X |
| X | X | X |
Displays specified HTML to browsers that do not recognize the APPLET tag.
Examples
Example 1:
%DEFINE DTW_APPLET_ALTTEXT = "<P>Sorry, your browser is not java-enabled."
Purpose
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
This special variable is used to override the default report Net.Data generates for functions that have no REPORT block. You can override this behavior by setting DTW_DEFAULT_REPORT to "NO", which means that functions without REPORT blocks do not display any results on the browser. This is useful, for example, if you receive the results of a function call in a table variable and want to pass the results to a different function to process.
Examples
Example 1:
%DEFINE DTW_DEFAULT_REPORT="NO"
Purpose
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Use this variable to display results in an HTML table instead of displaying the table in a text-type format (that is, using the TABLE tags rather than the PRE tags). YES displays table data using HTML table tags. The default action is to display table data in a text format.
The generated TABLE tag includes a border and cellpadding specification:
<TABLE BORDER CELLPADDING=2>
Examples
Example 1: This example shows an SQL function without a REPORT block. With DTW_HTML_TABLE set to YES, an HTML table is generated rather than a text-formatted table.
%DEFINE DTW_HTML_TABLE="YES"
%FUNCTION(DTW_SQL){
SELECT NAME, ADDRESS FROM $(qTable)
%}
Purpose
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Use this variable to specify text for the file header. If the variable is set to YES, or not specified, Net.Data, by default, prints out "Content-type: text/html" for the file header text. If the DTW_PRINT_HEADER variable is set to NO, you can print out HTTP header information. You must have this variable set before Net.Data processes any text sent to the browser because Net.Data reads this variable once before outputting text and does not look at it again. Any changes to the DTW_PRINT_HEADER variable are ignored after Net.Data has sent text to the browser.
One of the most common uses of this variable is to enable Net.Data macros to send cookies. To set a cookies, the DTW_PRINT_HEADER variable must be set to NO, and the first three lines must be the Content-type header, the Set-Cookie statement, and a blank line.
Examples
Example 1:
%DEFINE DTW_PRINT_HEADER="NO"
%HTML(cookie1) {
Content-type: text/html
Set-Cookie: UsrId=56, expires=Friday, 12-Dec-99, 12:00:00 GMT; path=/
<P>
Any text
%}
Purpose
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
|
|
|
|
| X |
|
|
|
You must set DTW_SET_TOTAL_ROWS to YES to use TOTAL_ROWS. If this variable is not defined, the default value is to not set the TOTAL_ROWS variable. Setting DTW_SET_TOTAL_ROWS to YES affects performance because to determine the total rows, the database language enviroment requires that all rows be retrieved.
Examples
Example 1:
%DEFINE DTW_SET_TOTAL_ROWS="YES" <P>$(ROW_NUM) returned. Your query is limited to $(TOTAL_ROWS) rows.
Purpose
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Specify the maximum number of rows that a report displays. The default is to return all rows that the table contains. Setting this variable to 0 or ALL also displays all rows.
Examples
The first example shows how to define the variable in a DEFINE statement. The second example shows how to use HTML input to define the variable with an HTML form.
Example 1: This limits the number of rows any function returns to 20 rows.
%DEFINE RPT_MAX_ROWS="20"
Example 2: These lines can be placed in a FORM tag to let the application user set the number of rows they want returned from a query.
Maximum rows to return (0 for no limit): <INPUT TYPE="text" NAME="RPT_MAX_ROWS" SIZE=3>
Purpose
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X |
| X |
| X | X |
This variable sets the row number to begin displaying the results of a query. Using this variable together with RPT_MAX_ROWS, you can break queries with large result tables into smaller sets and use a Next button to navigate through the result table.
START_ROW_NUM can be used only for databases when accessed through Live Connection, except on the OS/400 platform.