XVCL example - DBTable

The purpose of this example is to illustrate how you can use XVCL to create HTML documents with content retreived from an external data source. The program generates HTML table containing data from CUSTOMER.DB table in DBDEMOS database.

Press F9 to generate HTML content...

Components/classes used in this example

Key properties/technologies illustrated in this example

Note that all XVCL classes that descend from TJvxCompositeElement have these capabilities. They are not unique to TJvxHTMLTableBody class.

Implementation details

This example creates a template of an HTML document (FTable). The table consists of header and table body. The header has one row populated with cells displaying field names (see CreateTableHeaderRow method). Table body is connected to an external data source (FNodeSource: TJvxDBDataSource). Table body has a template row with cells connected to data fields provided by external data source (see CreateTableBodyRow method). FNodeSource is connected to the database using standard TTable (CustomerTable) and TDataSource (CustomerDataSource) components pointed to CUSTOMER.DB table in DBDEMOS database.

An instance of TJvxXMLGenerator class is used to generate HTML content using the template. Generated content is saved in Output.htm file.