Master / Detail SelectBox - Form
Using a template to display a form

Report Date: 5/20/2019 02:17 AM

The profile of customer ALFKI is as follows -

Name: Maria Anders

Works for: Alfreds Futterkiste

Title: Sales Representative

Address: Obere Str. 57, Berlin 12209 Germany

Phone: 030-0074321

Fax: 030-0076545

SelectBox Form Template
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
  Dim E16 As New Tornado.z
  With E16
    .dbUnit = 16
    .dbMode = "type=SBoxForm|SboxMacro=#0# - #1#"
    .dbSkin = "air"
    .dbGridDisplayFlds = "CustomerID, CompanyName, ContactName"
    .dbSelectedBoxFormTemplate = "File=./_SBoxFormTemp.txt"
    .dbDSN = "Nwind"
    .dbSQL = "SELECT * FROM Customers"
    .dbStatusBar = False
    .dbPageSize = -1
    .dbTextHolder = "Tit=Master / Detail SelectBox - Form|Sub=Using a template to display a form"
  End With
End Sub
Template File - SBoxFormTemp.txt
<p align="center">[[SelectBox]]</p> 
<center><table cellspacing='1' class=ts><TR><td class='r2'> 
<p>Report Date: [[Today::M/d/yyyy hh:mm tt]]</p> 
<p>The profile of customer [[F::CustomerID]] is as 
follows -</p> 
<p>Name: [[F::ContactName]]</p> 
<p>Works for: [[F::CompanyName]]</p> 
<p>Title: [[F::ContactTitle]]</p> 
<p>Address: [[F::Address]], [[F::City]] [[F::Region]] [[F::PostalCode]] 
<p>Phone: [[F::Phone]]</p> 
<p>Fax: [[F::Fax]]</p> 
This example extend the master/details drill down format and use a template to display the form. A template is a free form ascii file with embedded tags for positioning the field values and 'other' objects. The 'other' objects are very powerful and will be presented in detail in examples to follow. Look at the source code and teh template file and you'll get the idea.

Send comments on this topic.
Copyright (c) 1998-2006 ASP-db