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.
Formatting editable columnsThe 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.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
|