Demonstrate Net.data built-in reporting functions

DTW_TB_TABLE

This built-in function relies on the data in a Net.data %TABLE variable which are closely related to SQL result sets.
The Net.Data %TABLE variable used in this example is generated by populating it from the result of an SQL SQLECT statement.
Click here to show an explanation of this mechanism.

The DTW_TB_TABLE function renders a Net.data %TABLE variable as a formatted HTML table.
The result is similar to the DTW_TB_HTML_TABLE function with the addition of some basic formatting options.

The complete source for this example can be viewed at dtw_tb_table.

This example first runs a DTW_SQL function named @list() which selects records from the file QIWS/QCUSTCDT.
Function @list() does nothing other than return a %TABLE variable named mytable.
The built-in function DTW_TB_TABLE is then passed %TABLE mytable.
So there are just 2 lines within the %HTML block as follows -

@list(mytable)
@dtw_tb_table(mytable,"BORDER=1 CELLPADDING=4 CELLSPACING=0 WIDTH=600") 
This generates the HTML for a table from selected records of file QIWS/QCUSTCDT.
The HTML table is formatted using the 4 table attributes passed to the function.
When requested as a Net.data page the response should be -
CUSNUM LSTNAM INIT STREET CITY
938485 Johnson J A 3 Alpine Way Helen
389572 Stevens K L 208 Snow Pass Denver
475938 Doe J W 59 Archer Rd Sutter
192837 Lee F L 5963 Oak St Hector

Notice that the column headings for the table have been automatically populated with the corresponding database field name.

Back to Tutorial