Programming Reference Manual
 
Syntax
 
HtmBuildTable(TableType, rs, KeyField[, ControlName][, Caption][, EditFields])
 
Description
Returns a fully formatted table in html/javascript code for use in combination with the HtmParseFile method. You can choose in 3 different types of tables, and two styles:
List, lists only a table view in the specified style
Check, lists a table view, preceeded with an extra checkbox column. For checklist purposes, the checks can be read out with the HtmGetTableData function.
Edit, lists a table, where multiple columns can be edited. The EditFields variable holds the field names of these columns. Data can be read out with HtmGetTableData.
 
Style1, a modern style table, build with proportional (sans serif) font.
Style2, a flat table, build with a fixed (monotype) font (courier.
 
All records and fields in the ADODB.recordset variable are used as a source with the field names as the parameters.
The rows, columns and values are automatically formatted, based on the field size and type and, ocassionally and when needed, also based on parts of the field names.
 
Parameter
Description
TableType
Specifies the type and style of the table, styles are:
    TabTypListStyle1 = 0
    TabTypListStyle2 = 1
    TabTypCheckStyle1 = 2
    TabTypCheckStyle2 = 3
    TabTypEditStyle1 = 4
    TabTypEditStyle2 = 5
rs
A reference to a previously opened ADODB.recordset variable.
KeyField
The unique identifier for the current recordset, often is [RowID] used.
NOTE: the Keyfield is NOT visible in the table.
ControlName
Optional, specifies the name of the created table. Use when multiple tables exists in a web form.
Caption
Optional, places a caption, centered above the table view.
EditFields
Optional, except for Edit type tables. Can be a string variable, holding one field name, or an array, holding multiple field names.
Special format options can be added with  ';' as a separation character.
 

Formatting editable columns

The EditFields parameter is a single string, or an array of strings.Within each string, special formatting options can be added. Sometimes these options are obligatory, for example when using a select input type, where a list of options must be added.
 
Each formatting option is separated with the semi column character ( ; ). Their sorting is fixed, which means if a format option is not used, only the semi column needs to be inserted if the next option is used.
 
 
EditFields
position
Meaning
 
0
field name
 
1
TableEditType (text or numeric value), see table below for allowed values and text strings.
TabEditColor
2
Minimum value (e.q. text lenght, minimum date)
TabEditDate
3
Maximum value (e.q. maxium number, max. date)
TabEditDateTime
4
Pattern or max-width (e.q. "120px", or "[0],[A-z]")
TabEditEmail
5
Listitems (multiple values, split by a | character, or the result of a SQL query, preceeded with @. See example.
 
Table Edit type
Value
text
TabEditUndefined
0
""
TabEditCheckBox
1
"checkbox"
TabEditColor
2
"color"
TabEditDate
3
"date"
TabEditDateTime
4
"datetime-local"
TabEditEmail
5
"email"
TabEditFile
6
"file"
TabEditHidden
7
"hidden"
TabEditImage
8
"image"
TabEditMonth
9
"month"
TabEditNumber
10
"number"
TabEditPassword
11
"password"
TabEditRadio
12
"radio"
TabEditRange
13
"range"
TabEditReset
14
"reset"
TabEditSearch
15
"search"
TabEditSubmit
16
"submit"
TabEditTel
17
"tel"
TabEditText
18
"text"
TabEditUrl
19
"url"
TabEditWeek
20
"week"
TabEditButton
21
"button"
TabEditList
22
"list"
TabEditTime
23
"time"
TabEditSelect
24
"select"
See Also
Example
 
Sub Main
 
Dim Temp$
 
   TrmSetInterface "HTML"
 
   SQL.RunRecordset "SELECT * FROM dbo.usr_fn_loodslijst(1, " & OrderNr & ")", rs, adOpenKeyset, adLockReadOnly, adUseClient
   sTemp = "#LOODSLIJST#|" & HtmBuildTable( TabTypCheckStyle1, rs,"RowID", "Table1", "Werk deze lijst bij", _
           Array("Description;text;0;125","Pieces;number","Kgs;number;0;10000", "Box;number;0;1000", "Pallet;select;;;;euro|blue|half|-", "ProdDate;date", "ExpiryDate;date", "Orig;select;;;;@SELECT Land FROM usr_fn_Herkomst_Landen()"))
 
   HtmParseFile "tablet\edit_loodslijst.htm", sTemp
 
End Sub