![]()
Getting
the most out of the
Visual DataFlex 9.1 Sample Applications
A
Data Access Worldwide White Paper
by Dennis Piccioni
September 24, 2003
Last Edited: December 15, 2003
Visual DataFlex 9.1 combines the Visual DataFlex Windows application development and WebApp Server web application development environments and technologies into one product.
Visual DataFlex 9.1 provides sample applications for each of these two application types, including enhancements of the existing samples for Windows and web applications. The sample applications demonstrate many useful features and methods that developers want to incorporate into their applications. This paper tells you where in the samples specific features and techniques are used.
Contents
This paper is divided into 2 main sections, which contain mostly the same information, but are organized in different ways:
This section breaks down the samples by specific features used in the Visual DataFlex samples and points you to the places in the samples that the feature is demonstrated.
- Feature List
- Sample Technique Details (explanations and locations of features used in samples)
This section lists each of the Visual DataFlex samples and explains what features and techniques are demonstrated in that sample.
1. How Do I?
Click on the link below to see details on where in the Visual DataFlex samples any particular technique or feature is used.
ActiveX Controls Coding Styles Database OperationsData-Aware Controls & Classes Email & Internet Non-Data-Aware Controls & Classes Miscellaneous Topics
- Auto Incrementing Numeric Ids
- Custom Save & Delete Confirmations
- Database API Calls
- Dynamic Constraints
- Form View for Single Data File
- Form View with Related Data Files
- Form View with Related Tables and a non-related "suggestion" Data File
- dbGrid with Additional DEO Control to Display Extra Row Information
- DataFlex table and indexes, creating dynamically
- Simple Validation
- Data file, creating dynamically
- Validating Data during Save
- View with Child Table
- Updating order totals during data entry and update/backout
- Embedded SQL Statements
- Stored Procedures, Calling
This section details the use of specific features and techniques in the VDF samples.
- Each sub-topic starts with an entry like this showing you how to access the example:
Workspace: Windows > 'Order Entry Example'
Component: Customer Entry viewwhere:
Workspace: the workspace name: open in VDF Studio using File > Select Workspace
Component: the component name: open in VDF Studio using File > Open Component
- If necessary, an explanation is added to the subtopic. If no explanation is given, the code or documentation of the subtopic is assumed to be self-explanatory (documentation for many components is provided via comments in the source code).
Workspace: Advanced Components > 'COM Examples' workspace
Component: 'Calendar Popup Example (non-data aware)' view
- Demonstrates calendar popup ActiveX control using a non-synchronized prompt and a synchronized prompt.
- To see an HTML explanation page for the ActiveX samples, run the application, open the Internet Explorer Sample view and click the Sample Info button.
Workspace: Advanced Components > 'COM Examples' workspace
Component: 'Order Entry w/ data aware Calendar contr' view
- Demo of Order Entry View with embedded data-aware Calendar ActiveX control.
Workspace: Advanced Components > 'COM Examples' workspace
Component: 'Internet Explorer Sample' view
- Demo of Internet Explorer ActiveX control.
- To see an HTML explanation page for the ActiveX samples, run the application, open the Internet Explorer Sample view and click the Sample Info button.
Workspace: Advanced Components > 'COM Examples' workspace
Component: 'Media Player' view
- Demo of Windows Media Player ActiveX control.
- Shows use of custom toolbar for a view.
- To see an HTML explanation page for the ActiveX samples, run the application, open the Internet Explorer Sample view and click the Sample Info button.
Workspace: Advanced Components > 'COM Examples' workspace
Component: 'Simple Automation Control' view
- Demonstrates how to connect to, exchange messages with, and disconnect from an automation control.
Workspace: Windows > 'Order Entry Example'
Component: All programs, views and other components
- All object, class, variable and property names in this sample use Hungarian notation.
Workspace: Windows > 'Order Entry Example'
Component: All programs, views and other components
- All object references no longer use the Self syntax.
- Object Neighborhoods: object referencing is simplified via the use of object neighborhoods.
Workspace: Windows > 'Order Entry Example'
Component: DataDictionaries
- Customer, Vendor, OrderHea, & other data files have auto incremented unique numeric ids that are auto-incremented from a system file. These are incremented in Database Builder under Field Settings > Other > Auto Increment.
- Order Header DataDictionary decrements auto-incremented field (OrderHea.Order_Number) in Procedure Deleting if system file counter is equal to last order number.
Workspace: Windows > 'Order Entry Example'
Component: 'Order Entry' view
- Custom save and delete confirmations are coded in these following functions in oOrderEntryView:
- Function Confirm_Delete_Order
- Function Confirm_Save_Order
Workspace: Advanced Components > 'Data Definition (API)'
Component: All
- This sample application contains sample code to go along with the Data Definition in VDF white paper. Please read this white paper for detailed information on this topic.
Workspace: Windows > 'Contact Management Example'
Component: 'Contacts' view
- Allows user to dynamically toggle constraint on or off using Radios.
Workspace: Windows > 'Order Entry Example'
Component: 'Customer Entry View' viewWorkspace: Windows > 'Order Entry Example'
Component: 'Sales Person Entry View' viewWorkspace: Windows > 'Order Entry Example'
Component: 'Vendor Entry View' viewWorkspace: Windows > 'Order Entry Example'
Component: 'Inventory Item View' viewWorkspace: Windows > 'Wine Collector's Example'
Component: 'Wine Entry' viewWorkspace: Windows > 'Contact Management Example'
Component: 'Contacts' view
- The 'Call Notes' dbEdit has same server as the 'Call Detail' dbGrid. It shows notes for the currently active record in the 'Call Detail' dbGrid.
Workspace: Advanced Components > 'Embedded SQL Example'
Component: 'Customer by total amount ordered' report view
- Procedure RunDataFlexReport in this report view creates a temporary DataFlex table with 2 indexes, then fills the table with data, so that a specific query (report) can then be run on this new table.
Workspace: Windows > 'Order Entry Example'
Component: Vendor DataDictionary
- Vendor DataDictionary uses simple validation for Vendor.State field.
Workspace: Advanced Components > 'Data Definition (API)'
Component: All
- This sample application contains sample code to go along with the Data Definition in VDF white paper. Please read this white paper for detailed information on this topic.
Workspace: Windows > 'Order Entry Example'
Component: Inventory DataDictionary
- Checks for inventory stock during Validate_Save.
Workspace: Windows > 'Order Entry Example'
Component: 'Order Entry' view
- The Order Entry view has order (OrderHea) information at the top and a dbGrid for order detail items (oOrderDtl_Grid) at the bottom. What makes this a true "child table" is that you cannot enter into oOrderDtl_Grid unless a OrderHea record is saved. This is enforced by the following code:
- Child_Table_State is True in oOrderDtl_Grid
- Function Child_Entering in oOrderDtl_Grid
- Function Save_Header in oOrderEntryView
Workspace: Windows > 'Contact Management Example'
Component: 'Contacts' view
- Demonstrates 2 detail dbGrids from 2 separate child data files in header/detail scenario.
Workspace: Windows > 'Order Entry Example'
Component: OrderDtl DataDictionary
- During order detail entry, totals are dynamically adjusted by Procedure Adjust_Display_Total, which is called as Field_Exit_msg from OrderDtl.Price and OrderDtl.Qty_Ordered.
- See the Methods tab of Database Builder to view the code for Procedure Adjust_Display_Total
- See Database Builder > Field Settings > Other > Exit Method for OrderDtl.Price and OrderDtl.Qty_Ordered
Workspace: Advanced Components > 'Embedded SQL Example'
Component: All
- This sample application contains sample code that works with any Connectivity Kit that supports embedded SQL statements. Please read the Embedded SQL User's Guide for detailed information on this topic.
Workspace: Advanced Components > 'Embedded SQL Example'
Component: 'Stored Procedure Sample (ODBC)' view
- Demonstrates calling of a Stored Procedure via the ODBC Connectivity Kit, as discussed in chapter 3 of the Embedded SQL User's Guide.
Workspace: Advanced Components > 'Embedded SQL Example'
Component: ''Stored Procedure Sample (MSSQL)' view
- Demonstrates calling of a Stored Procedure via the Microsoft SQL Connectivity Kit, as discussed in chapter 3 of the Embedded SQL User's Guide.
Workspace: Windows > 'Order Entry Example'
Component: 'Order Entry' viewWorkspace: Windows > 'Order Entry Example'
Component: 'Customer Entry' view
- dbEdit for Customer.Comments on Comments dbTabPage.
Workspace: Windows > 'Contact Management Example'
Component: 'Contacts' view
- The 'Call Notes' dbEdit has same server as the 'Call Detail' dbGrid. It shows notes for the currently active record in the 'Call Detail' dbGrid.
- Almost every sample application contains dbForms, the most frequently used data-aware control.
Workspace: Windows > 'Order Entry Example'
Component: 'Order Entry' view
- See View with Child Table section
Workspace: Windows > 'Contact Management Example'
Component: 'Contacts' view
- See View with Child Table section
Workspace: Windows > 'Wine Collector's Example'
Component: 'Available Wines' lookupWorkspace: Windows > 'Order Entry Example'
Component: 'Order Entry' viewWorkspace: Windows > 'Wine Collector's Example'
Component: 'Wine Entry' viewWorkspace: Windows > 'Wine Collector's Example'
Component: 'Wine Maintenance' view
- Uses dbTabDialogView with separate DDOs for each dbTabView.
Workspace: Advanced Components > 'Internet Transfer (FTP) Example' Sample Application
Component: All
- The Download a File from an FTP Server view is a complete view for downloading files from an FTP site.
- The Upload a File to an FTP Server view is a complete view for uploading files to an FTP site.
Workspace: Advanced Components > 'MAPI Example'
Component: All
- Contains 2 programs:
- Mapi Sample: full MAPI sample application.
- Send a message without visual components: shows how to send a MAPI email message without a user interface.
- Has 6 custom classes that are added to the Studio Controls Palette on MAPI tab page.
- Included Order Sample Customer Entry view with email enhancements.
Workspace: Advanced Components > 'XML Examples'
Component: All
- Sample with 5 different views with an Internet Explorer (cComWebBrowser) ActiveX control demonstrating different XML techniques.
- Each view has a "What does this sample do?" button that opens an HTML document that explains what the view does in detail.
- The code in each view is commented well.
- The following topics are shown in the 5 sample views:
- Basic XML parsing.
- Writing data from a DataDictionary object (DDO) to an XML document.
- Reading XML document.
- Writing data from one or multiple data files to an XML document.
- Basic XSL transformation of an XML document and displaying it as an HTML document.
Workspace: Web > WebAppSample91
Component: More About XML (MoreXml.asp)' page
- Explains how to use Visual DataFlex Web Application Server as an XML document server.
- Lists XML sample pages that are included in this sample application.
- Includes explanations of what each of the XML pages does.
Workspace: Web > XMLSample91
Component: 'XML Tests (Xml.wo)' WOWorkspace: Web > XMLSample91
- This sample is actually meant to be accessed from another Web application. The sample XMLSample91 makes a call this application to demonstrate server to server exchange of XML data. The XMLSample91 application is the primary example of XML usage and you should refer to that application for more information about using XML in Visual DataFlex Web Application Server.
- Contains 5 functions used for processing XML in this sample application.
Component: Test-XML-WO.asp page
- This page can be used to test that the Web Service function is working. If it works properly, you will see a dynamically generated customer list displayed in your browser as a tree view.
Workspace: Web > XMLSample91
Component: 'Get XML data from server (XMLGetter.vw)' view
- You should work with this sample application by opening the 'XML Getter Sample for Windows Client' program in this workspace in the Studios and running it.
- This view shows how a Visual DataFlex Windows (non-web) application can be used as an HTTP client. It demonstrates this by calling two Web Services from the XMLSample91 Visual DataFlex Web Application Server sample application.
- Requests a list of customers from the web server, gets the list back as an XML document, parses the document and displays the result in a Grid object.
- Deletes selected customers from the list (Grid) by passing an XML document to the web server with the Delete attribute for selected customers.
- This view is extremely well documented comments in the code.
Workspace: Web > WebAppSample91
Component: Customer.asp, SalesP.asp, Vendor.asp. Invt.asp, Customer0.asp, Customer1.asp, Customer2.asp, Customer3.asp, Vendor0.aspWorkspace: Web > WebAppSample91
Component: 'List Customers (CustomerReport.asp)' pageWorkspace: Web > WebAppSample91
- This report lists customer records using the selected Index.
- Customer records listed can be constrained by customer number.
- Once customer records are listed, each listed records can be clicked to display details about the customer record and that customer's orders. Each order listed can also be clicked to display the details of that order.
- This report calls functions in the 'Customer Information Drill Down Report (CustomerReport.wo)' Web Object (WO) via the Call interface.
Component: 'List Orders (OrderReport.asp)' pageWorkspace: Web > WebAppSample91
- This report lists all order records, broken down by customer.
- Each order listed can be double-clicked to display the details of that order.
- This report calls functions in the 'Orders by Customer Report (OrderReport.wo)' Web Object (WO) via the Call interface.
Component: 'Vendor Listing (VendorList.asp)' pageWorkspace: Web > WebAppSample91
- This report lists all vendor records by the selected index.
- Each vendor listed can be clicked to display the details of that vendor record.
- This report calls functions in the 'Vendor: Entry, Reporting and Maintenance (Vendor.wo)' Web Object (WO) via the Call interface.
Component: 'Vendor Parts List (InvtList.asp)' page
- This report lists all parts (inventory) records for the selected vendor.
- Each part listed can be clicked to display the details of that parts record.
- This report calls functions in the 'Inventory; Entry, Report and Maintenance (Invt.wo)' Web Object (WO) via the Call interface.
Workspace: Web > XMLSample91
Component: 'Get XML data from server (XMLGetter.vw)' viewWorkspace: Web > XMLSample91
- You should work with this sample application by opening the 'XML Getter Sample for Windows Client' program in this workspace in the Studios and running it.
- This view shows how a Visual DataFlex Windows (non-web) application can be used as an HTTP client. It demonstrates this by calling two Web Services from the XMLSample91 Visual DataFlex Web Application Server sample application.
- Requests a list of customers from the web server, gets the list back as an XML document, parses the document and displays the result in a Grid object.
- Deletes selected customers from the list (Grid) by passing an XML document to the web server with the Delete attribute for selected customers.
- This view is extremely well documented comments in the code.
Component: CustXMLSrvc.asp pageWorkspace: Web > XMLSample91
- This is a sample of a web service that could be requested by any HTTP client. It knows how to build and return a customer list and it knows how to delete customers from a passed list - all data is passed in XML, of course. As with all samples, this makes requests to the oXML WO. All response and request data is pure XML and is an example of server side programming.
- This will get called by two different client examples. CustomerListSample.asp shows how to make these requests using a browser as the client. XMLGetter.vw shows how to access this service from a VDF application.
Component: 'XML tests (XML.wo)' WO
- This WO provides all of the XML web services used in this sample. It shows how you use Visual DataFlex Web Application Server's XML parser to create, load, parse, and return XML data.
Workspace: Web > WebAppSample91
Component: 'More About WML (MoreWml.asp)' page
- Explains hot to use Visual DataFlex Web Application Server with WAP devices using WML.
- Shows "Getting Started" information and lists other sources for writing WML applications.
- Lists WML sample pages and web objects (WOs) that are included in this sample application.
- Includes explanations of what each of the WML pages does.
Workspace: Web > WebAppSample91
Component: Wml-Sample-1.wml pageWorkspace: Web > WebAppSample91
- This creates a "Hello World" type of WML page.
Component: Wml-Sample-2.wml pageWorkspace: Web > WebAppSample91
- This sample was created to give you an idea of what a WML report might look like. This uses the WML <select> and <option> tags to create the report. You would rarely ever create a static page like this. Instead, you would use Visual DataFlex Web Application Server to generate a report like this dynamically (which is exactly what the WAP Report wizard does and is what the WAPCustList sample does).
Component: Wml-Sample-3.wml pageWorkspace: Web > WebAppSample91
- This sample was created to give you an idea of what a WML Display form might look like. Normally a page like this would be generated dynamically (which is exactly what the WAP Entry wizard does and is what the WAPCustList sample does). The results of that dynamic generation would look like this page.
Component: Wml-Sample-4.wml pageWorkspace: Web > WebAppSample91
- This sample was created to give you an idea of what a WML input form might look like. It uses the WML <input> tag to generate the input controls. Normally a page like this would be generated dynamically (which is exactly what the WAP Entry wizard does and is what the WAPCustList sample does). The results of that dynamic generation would look like this page.
Component: Wml-Sample-5.wml pageWorkspace: Web > WebAppSample91
- Unlike the other samples, this uses an ASP page which dynamically creates the WML page. This sample was created by loading the WML template sample. It contains the basics of needed to build a dynamic WML page.
Component: WAPCustList.asp pageWorkspace: Web > WebAppSample91
- This ASP page is requested when you wish to display a list of customers. It is used to initialize the report (select the index), seed the report (determine which record to start at) and to generate the report, which is accomplished by making a call to the oWAPCustList WO.
- This sample is generated entirely by Visual DataFlex Web Application Server's WAP Report generation wizard. These components are used in conjunction with the entry components, WAPCustomerMaint.asp and WAPCustomerMaint.WO.
Component: WAPCustomerMaint.asp page
- This ASP page is requested when you wish to display, edit or delete customer data. The ASP page contains the presentation logic and the oWAPCustomerMaint WO is used to handle all business logic (find records, save new records, edit records, find records, delete records).
- This sample is generated entirely by Visual DataFlex Web Application Server's WAP Entry generation wizard. These components are used in conjunction with the report components, WAPCustList.asp and
WAPCustList.WO.- Note that the WO, oWAPCustomerMaint is identical to the WO created by the Customer Entry HTML page (oCustomer). Had we wished, a single WO could be used to provide all services for both HTML and WML pages (after all this is business logic, which should be independent of display). We created two separate WOs to keep the samples clear.
Workspace: Windows > 'Wine Collector's Example'
Component: Wines.mnWorkspace: Windows > 'Wine Collector's Example'
Component: Mapi.mnWorkspace: Windows > 'Order Entry Example'
Component: OrderToolbar.pkg
- Custom toolbar with popup menu (DFBaseEditPullDown) for views.
Workspace: Windows > 'Wine Collector's Example'
Component: 'Wines Entry' view
- ImageList for icons to use on tab buttons of dbTabPages.
Workspace: Advanced Components > 'Internet Transfer (FTP) Example' Sample Application
Component: 'Upload File to FTP Server' viewWorkspace: Windows > 'Contact Management Example'
Component: 'Contacts' viewMost reports use Radios and RadioGroups for selection criteria. See the Reporting section for details.
Workspace: Windows > 'Contact Management Example'
Component: 'Contacts Maintenance' report viewWorkspace: Advanced Components > 'TreeView Example'
Component: 'Organization TreeView' view
- Demonstrates a database-connected TreeView.
- Most methods have elaborate comments explaining what they do.
Workspace: Advanced Components > 'Internet Transfer (FTP) Example' Sample Application
Component: 'Download File from FTP Server' view
Workspace: Windows > 'Order Entry Example'
Component: 'Customer Listing (Basic Report)' report view
- Uses selection criteria for output to screen or printer and ordering by customer number or name (using Radios in a RadioGroup).
Workspace: Windows > 'Order Entry Example'
Component: 'Print Orders (Crystal)' report view
- Uses selection criteria for output to screen or printer (using Radios in a RadioGroup).
Workspace: Windows > 'Order Entry Example'
Component: 'Print Orders by Customer' report view
- Uses selection criteria for choosing to print detail or summary (using Radios in a RadioGroup).
Workspace: Windows > 'Order Entry Example'
Component: 'Standard Customer Listing (Crystal)' report view
- Very complex Crystal Reports sample report view.
- Uses selection criteria for:
- Sort by customer number or name (using Radios in a RadioGroup), in ascending or descending order (using a CheckBox).
- Output to window, printer, file or email (using Radios in a RadioGroup).
- Limit customer numbers (choose starting & ending).
- Limit customer names (choose starting & ending).
- Export to a specified file name and choose an output format for the file ("Word for Windows", "Excel 2.1", "Excel 3.0", "Excel 4.0", "Excel 5.0", "Rich Text", "Text", "Record Style", "Comma Separated", "Data Interchange Format (DIF)").
Workspace: Windows > 'Order Entry Example'
These are 2 ReportViews that are not compiled into the Order Sample application, which do some very cool stuff:
Component: 'Crystal Report Info' report view & 'Crystal Report preview in DF Dialog' report view
- Crystal Report Info - allows dynamic choosing of any Crystal Reports report and analyzes it to display the report's Selections, Sort Order and Formulas.
- Crystal Report preview in DF Dialog - allows dynamic choosing, running, previewing, resizing and exporting of any Crystal Reports report.
Workspace: Windows > 'Wine Collector's Example'
Component: 'Wine Reports' report view
- Uses selection criteria for choosing report type (using Radios in a RadioGroup), which actually chooses among 2 different reports to print.
- Uses selection criteria for choosing print mode (using Radios in a RadioGroup): List All Wines, List only Unopened, List only Opened.
- WinPrint reports
Workspace: Windows > 'Order Entry Example'
Component: 'Customer Listing (WinPrint)' report view
- Uses selection criteria for:
- Output to screen or printer (using Radios in a RadioGroup).
- Ordering by customer number or name (using Radios in a RadioGroup).
- Has button for Printer Setup.
Workspace: Windows > 'Contact Management Example'
Component: 'Contacts List (from Wizard)' report view
- This is a sample view created entirely using the Studio Report Wizard.
- Uses selection criteria for:
- Output to screen or printer.
- Limit contacts last names (choose starting & ending).
- Limit contacts by company (choose starting & ending).
- Limit contacts by status (choose starting & ending).
Workspace: Windows > 'Contact Management Example'
Component: 'List Contacts (Summary)' report view
- Uses selection criteria for:
- Output to screen or printer (using Radios in a RadioGroup).
- Limit contacts last names (choose starting & ending).
- Limit contacts by company (choose starting & ending).
- Limit contacts by status (using Radios in a RadioGroup).
- Choose output sort order (using Radios in a RadioGroup).
Workspace: Windows > 'Contact Management Example'
Component: 'List Contacts (Detail)' report view
- Uses selection criteria for:
- Output to screen or printer (using Radios in a RadioGroup).
- Limit contacts last names (choose starting & ending).
- Limit contacts by company (choose starting & ending).
- Limit contacts by status (using Radios in a RadioGroup).
- Choose output sort order (using Radios in a RadioGroup).
- Uses a CheckBox for choosing to create a new page for each contact (page break).
Workspace: Windows > 'Order Entry Example'
Component: All
- Most components in this sample are resizable via anchors as appropriate.
Workspace: Windows > 'Contact Management Example'
Component: 'Contacts Maintenance' report view
- Uses a BPO to import data from a text file and writes status data to statlog data file during processing.
- Uses a BPO to delete duplicate records from contacts data file and writes status data to statlog data file during processing.
Workspace: Advanced Components > 'XML Examples'
Component: 'Basic XML 2' view
- Writes data from a DDO to an XML document using BPO.
Workspace: Advanced Components > 'XML Examples'
Component: 'Basic XML 3' view
- Reads XML document created in Basic XML 2 using BPO.
Workspace: Advanced Components > 'XML Examples'
Component: 'Basic XML 4' view
- Writes data from one or multiple data files to an XML document using 3 different BPOs.
Workspace: Windows > 'Big (combines Order, Contact and Wines)'
Component: All
- Demonstrates how to combine application components from different workspaces into a single application.
- Creates a larger single application from several: Order, Contacts, Wines.
- Uses single filelist with data files from all 3 applications included.
- Custom menu, combines views and reports from all 3 applications.
Workspace: Windows > 'Order Entry Example'
Component: 'Order Entry Sample Application' program
- Uses multiple bitmaps as embedded resources. These can be seen by opening the program in the Studio, then clicking on the Application Properties button below the program outline and clicking on the Bitmaps tab page.
- The embedded bitmaps are used on the program toolbar and the Help > About dialog.
Workspace: Windows > 'Wine Collector's Example'
Component: 'Wines Program' program
- Uses multiple icons and bitmaps as embedded resources. These can be seen by opening the program in the Studio, then clicking on the Application Properties button below the program outline and clicking on the Icons and Bitmaps tab pages.
- The embedded bitmaps are used on the program toolbar and the Help > About dialog.
- Each individual view uses a specific icon by setting its Icon property to one of the embedded icons (e.g. Wine.ico).
Workspace: Windows > 'Order Entry Example'
Component: 'Order' view
- Generic Errors: Specific error numbers in code were replaced with generic errors.
- See Function Save_Header in oOrderEntryView.
Workspace: Windows > 'Order Entry Example'
Component: All views
- Has a WinHelp help file
- Has customized Help_Ids.inc file.
- Uses Help Id's from Help_Ids.inc to pop up specific help topics for each view.
Workspace: Utilities > VDFOEMAnsi
Component: 'OEM Ansi Converter' dialog
- This is the source code for the OEM Ansi Wizard available from the Database Builder Database menu. You may view and analyze this code at will, however, the code is not extensively documented and not supported by DAW technical support.
Workspace: Advanced Components > 'Internet Transfer (FTP) Example' Sample Application
Component: 'Upload File to FTP Server' view
- The oPassword_fm Form control has the Password_State set to True to mask the user password with asterisk characters (*).
Workspace: Web > WebAppSample91
Component: 'Login (Login.asp) ' page
- This page allows the user to log in with a username and password.
- If a valid username and password are supplied, a temporary cookie is created (the cookie expired when the browser session is closed) and the user gets rights to save and delete records on the data entry pages (Customer.asp, SalesP.asp, Vendor.asp, Invt.asp).
Workspace: Advanced Components > 'Data Definition (API)'
Component: 'Sentinel for Database API Sample' program
- This program is a customized Status Panel (Sentinel) program with a ProgressBar control.
Workspace: Advanced Components > 'Internet Transfer (FTP) Example' Sample Application
Component: 'Sentinel for InetTransfer Sample' program
- This program is a customized Status Panel (Sentinel) program.
List of Samples (click on a link to go to information about that sample)
Our samples are currently divided into 3 groups of workspaces:
DAW.Advanced Components.COM Examples
General
- Demonstrates use of different ActiveX controls.
- To see an HTML explanation page for the ActiveX samples, run the application, open the Internet Explorer Sample view and click the Sample Info button.
Views
'Calendar Popup Example (non-data aware)' view
- Demonstrates calendar popup ActiveX control using a non-synchronized prompt and a synchronized prompt.
- To see an HTML explanation page for the ActiveX samples, run the application, open the Internet Explorer Sample view and click the Sample Info button.
'Order Entry w/ data aware Calendar contr' view
- Nice demo of Order Entry View with embedded data-aware Calendar ActiveX control.
- To see an HTML explanation page for the ActiveX samples, run the application, open the Internet Explorer Sample view and click the Sample Info button.
'Media Player' view
- Demo of Windows Media Player ActiveX control.
- To see an HTML explanation page for the ActiveX samples, run the application, open the Internet Explorer Sample view and click the Sample Info button.
- Shows use of custom toolbar for a view.
'Internet Explorer Sample' view
- Demo of Internet Explorer ActiveX control.
- To see an HTML explanation page for the ActiveX samples, run the application, open the Internet Explorer Sample view and click the Sample Info button.
'Simple Automation Controller' view
- Demonstrates how to connect to, exchange messages with, and disconnect from an automation control.
DAW.Advanced Components.Data Definition (API)
General
- This sample application contains sample code to go along with the Data Definition in VDF white paper. Please read this white paper for detailed information on this topic.
- Includes customized Status Panel (Sentinel) program with ProgressBar control ('Sentinel for Database API Sample' program).
DAW.Advanced Components.Embedded SQL Example
General
- This sample application contains sample code that works with any Connectivity Kit that supports embedded SQL statements. Please read the Embedded SQL User's Guide for detailed information on this topic.
Views
'Stored Procedure Sample (ODBC)' view
- Demonstrates calling of a Stored Procedure via the ODBC Connectivity Kit, as discussed in chapter 3 of the Embedded SQL User's Guide.
'Stored Procedure Sample (MSSQL)' view
- Demonstrates calling of a Stored Procedure via the Microsoft SQL Connectivity Kit, as discussed in chapter 3 of the Embedded SQL User's Guide.
'User's Guide Chapter 3 Sample (ODBC)' view
- This sample demonstrates 2 topics discussed in chapter 3 of the Embedded SQL User's Guide via the ODBC Connectivity Kit: executing a query using the message interface or using the command interface.
'User's Guide Chapter 3 Sample (MSSQL)' view
- This sample demonstrates 2 topics discussed in chapter 3 of the Embedded SQL User's Guide via the Microsoft SQL Connectivity Kit: executing a query using the message interface or using the command interface.
'User's Guide Chapter 3 Sample (MSSQL)' view
- This sample demonstrates 2 topics discussed in chapter 3 of the Embedded SQL User's Guide via the Microsoft SQL Connectivity Kit: executing a query using the message interface or using the command interface.
Report Views
'Customer by total amount ordered' report view
Executes a query to list all customers who ordered more than $1000, ordered by the total amount ordered via:
A loop through a DataFlex data file.
An SQL query against an SQL database.
Note that the DataFlex procedure creates a temporary data file and fills it with data to execute the query.
'Customer who ordered above average' report view
Executes a query to list all customers who placed at least one order with an amount above the average order amount via:
A loop through a DataFlex data file.
An SQL query against an SQL database.
'Embedded SQL Query' report view
Very flexible Embedded SQL test view.
Allows the user to execute any SQL query against any ODBC-compliant data source.
Allows user to store SQL queries and open saved queries from files.
DAW.Advanced Components.Internet Transfer (FTP) Example
General
- Shows how to upload and download files from and to FTP servers.
- Includes customized Status Panel (Sentinel) program.
- Uses OpenDialog and SaveAsDialog controls.
- Demonstrates Form control with Password_State set to True.
DAW.Advanced Components.MAPI Example
General
- Contains 2 programs:
- Mapi Sample: full MAPI sample application.
- Send a message without visual components: shows how to send a MAPI email message without a user interface.
- Has 6 custom classes that are added to the Studio Controls Palette on MAPI tab page.
- Included Order Sample Customer Entry view with email enhancements.
DAW.Advanced Components.TreeView Example
General
- Demonstrates a database-connected TreeView.
- Most methods have elaborate comments explaining what they do.
DAW.Advanced Components.XML Examples
General
- Sample with 5 different views with an IE ActiveX control demonstrating different XML techniques.
- Each view has a "What does this sample do?" button that opens an HTML document that explains what the view does in detail.
- As of VDF 9.1, this sample has been updated to use FlexCOM 2.
Views
Basic XML 1
- Basic XML Parsing.
Basic XML 2
- Writes data from a DDO to an XML document using Business Process Object (BPO).
Basic XML 3
- Reads XML document created in Basic XML 2 using Business Process Object (BPO).
Basic XML 4
- Writes data from one or multiple data files to an XML document using 3 different Business Process Objects (BPOs).
Basic XML 5
- Basic XSL transformation of an XML document and displays it as an HTML document.
DAW.Windows.Order Entry Example
General
- Most components are resizable via anchors as appropriate.
- All syntax and object-naming conventions are updated to VDF 9.0 level.
- Custom toolbar (cToolbar with popup menu (DFBaseEditPullDown) for views).
- Auto generated menus.
- All lookup lists have
- pbHeaderTogglesDirection True
- Auto_Server_State False
- Auto_Index_State True
- Has custom program icon.
- Code is well commented.
Help
- Has a WinHelp help file.
- Has customized Help_Ids.inc file.
- Uses Help Id's from Help_Ids.inc to pop up specific help topics for each view.
Views
'Order Entry' view
- Header/detail type of view
- child_table_state set to true
- child_entering
- Enabling/disabling of buttons and DEOs based on having a record found or not.
- Spin button in dbGrid.
- Custom confirm methods for save & delete.
- Printing of current order from view.
- dbSpinForm and dbComboForm controls.
'Customer Entry View' view
- Shows tab dialogs.
'Inventory Item View' view
- Shows 2 related, but unconstrained data files in non-dbGrid form (as opposed to header/dbGrid form like Order Entry).
Data Dictionaries
Order Header DD
- Defaults date.
- Decrements auto-increment field if sysfile eq last order number in Deleting.
Order Detail DD
- Maintains totals in Update/Backout.
- Maintains and adjust totals and prices during entry.
Inventory DD
- Checks for inventory stock during Validate_Save.
Vendor DD
- Simple validation for states.
Reports
- Uses all 3 report types: BasicReport, WinPrint and Crystal.
- There are 2 ReportViews that are not compiled into the Order Sample app, which show some cool stuff:
- Crystal Report Info - allows dynamic choosing of any Crystal Reports report and analyzes it to display the report's Selections, Sort Order and Formulas.
- Crystal Report preview in DF Dialog - allows dynamic choosing, running, previewing, resizing and exporting of any Crystal Reports report.
DAW.Windows.Wine Collector's Example
General
- Uses multiple icons as embedded resources.
- Custom menu, instead of auto generated menus (nothing fancy, just a plain menu).
- Has custom program icon.
- Available Wines lookup list uses checkboxes.
- Contains a data file that is not related to any other file in the application. This file is used in a non relational way to provide a list of suggestions for another field.
Views
'Wines Entry' view
- Header/detail type of view using a dbTabDialog to show details.
- dbTabPages have icons on tab buttons.
- ImageList for icons to use on dbTabPages.
- Shows how to use a selection-list in a non-relational manner. The same list will also be used relationally in the Maintenance view.
'Wines Maintenance' view
- Uses dbTabDialogView with separate DDOs for each dbTabView.
Reports
'Wine Reports' report view
- Crystal Reports report with selection criteria.
DAW.Windows.Contact Management Example
General
- Has custom program icon.
- Custom toolbar with really big buttons (the button text is beneath its image, making it larger).
- Custom menu with separate pulldown menus for Maintenance and Reports.
- Select Contact lookup list uses checkboxes.
Views
'Contacts' view
- Demonstrates 2 detail dbGrids from 2 separate child data files in header/detail scenario.
- Uses dbEdit connected to same server as call detail records that shows notes for the current record in the dbGrid.
- Shows use of non-data-aware radios (in RadioGroup).
- Allows user to dynamically toggle constraint on or off using radios.
'Contacts Maintenance' view
- Uses non-data-aware TabDialogs.
- Uses BusinessProcess object (BPO) to import data from a text file and writes status data to statlog data file during processing.
- Uses BusinessProcess object (BPO) to delete duplicate records from contacts data file and writes status data to statlog data file during processing.
Data Dictionaries
Calls DD
- Defaults date.
Reports
'List Contacts (Summary)' report view'List Contacts (Detail)' report view
- Winprint report with 3 different sets of possible constraints that can be toggled by selecting records from lookup lists or toggling radios.
- Has set of radios for selecting report sort order.
- Winprint report with 4 different sets of possible constraints that can be toggled by selecting records from lookup lists or toggling radios.
- Has set of radios for selecting report sort order.
- Has checkbox for page break for each contact.
DAW.Windows.Big (combines Order, Contact and Wines)
General
- Demonstrates how to combine application components from different workspaces into a single application.
- Creates a larger single application from several: Order, Contacts, Wines.
- Uses single filelist with data files from all 3 applications included.
- Custom menu, combines views and reports from all 3 applications.
General
- This sample is not an actual Web application. It is a single Active Server Pages (ASP) page (default.asp) that allows you to verify that Internet Information Server (IIS) and ASP are working properly on the PC on which you are running Visual DataFlex Web Application Server. Since the Visual DataFlex Web Application Server uses the underlying IIS technology, IIS must be installed and work properly to develop and run web applications with Visual DataFlex.
When you run this test page in your browser, the instructions on the page will tell you how to verify that IIS is running properly.DAW.Web.Data Entry and Report Example
General
- This is the main Visual DataFlex Web Application Server sample application. It demonstrates many techniques for using web applications with standard web browsers, WAP wireless devices (e.g. cell phones) and via XML data exchange.
ASP Pages
Main Web-Based Order sample
'Customers (Customer.asp)' page'Sales People (SalesP.asp)' page
- Allows user to display and find customer records using selected Index.
- Allows user to list customer records using selected Index.
- If logged in via Login (login.asp) page, allows user to save and delete customer records, and clear the page to create new customer records.
'Vendors (Vendor.asp)' page
- Allows user to display and find sales person records using selected Index.
- Allows user to list sales person records using selected Index.
- If logged in via Login (login.asp) page, allows user to save and delete sales person records, and clear the page to create new sales person records.
'Inventory Items (Invt.asp)' page
- Allows user to display and find vendor records using selected Index.
- Allows user to list vendor records using selected Index.
- If logged in via Login (login.asp) page, allows user to save and delete vendor records, and clear the page to create new vendor records.
- Allows user to list parts list (inventory) for a selected vendor.
'List Customers (CustomerReport.asp)' page
- Allows user to display and find inventory records using selected Index.
- Allows user to list inventory records using selected Index.
- If logged in via Login (login.asp) page, allows user to save and delete inventory records, and clear the page to create new inventory records.
- Allows user to list parts list (inventory) for a selected vendor.
'List Orders (OrderReport.asp)' page
- This report lists customer records using the selected Index.
- Customer records listed can be constrained by customer number.
- Once customer records are listed, each listed records can be clicked to display details about the customer record and that customer's orders. Each order listed can also be clicked to display the details of that order.
- This report calls functions in the 'Customer Information Drill Down Report (CustomerReport.wo)' Web Object (WO) via the Call interface.
Workspace: Web > WebAppSample91
- This report lists all order records, broken down by customer.
- Each order listed can be clicked to display the details of that order.
- This report calls functions in the 'Orders by Customer Report (OrderReport.wo)' Web Object (WO) via the Call interface.
'Vendor Listing (VendorList.asp)' pageWorkspace: Web > WebAppSample91
- This report lists all vendor records by the selected index.
- Each vendor listed can be clicked to display the details of that vendor record.
- This report calls functions in the 'Vendor: Entry, Reporting and Maintenance (Vendor.wo)' Web Object (WO) via the Call interface.
'Vendor Parts List (InvtList.asp)' page
- This report lists all parts (inventory) records for the selected vendor.
- Each part listed can be clicked to display the details of that parts record.
- This report calls functions in the 'Inventory; Entry, Report and Maintenance (Invt.wo)' Web Object (WO) via the Call interface.
Login (Login.asp)' page
- This page allows the user to log in with a username and password.
- If a valid username and password are supplied, a temporary cookie is created (the cookie expired when the browser session is closed) and the user gets rights to save and delete records on the data entry pages (Customer.asp, SalesP.asp, Vendor.asp, Invt.asp).
Additional HTML/ASP Pages
The pages listed here are HTML (ASP) not part of the main web-based order application as listed on the main page (default.asp).
'More About HTML (MoreHtml.asp)' page'Debug (Debug.asp)' page
- Contains explanations about the HTML (ASP) web application pages in this sample application.
- Lists additional HTML (ASP) pages.
- Includes explanations of what each of the additional pages does and includes a link to these pages.
Customer0.asp page
- Toggles debug mode in ASP pages. When toggled to ON, these pages will all display the data that has been submitted by the browser. This is both a very useful debugging technique and a great way understand how data is submitted to the server.
Customer1.asp page
- This shows many different examples of using the DDValue property in an ASP page. The
same type of control is created using multiple techniques.Customer2.asp page
- This uses the DDAUTO parameter in DDValue to create all of the controls. DDAUTO tells
the WO to create a the most appropriate control for a field based on the field's DD
characteristics..Customer3.asp page
- This sample lets you see how you can mix server side ASP script (VBScript) and WO
processing power. In this case, the controls are all built inside of a single VBScript
sub-routine. This subroutine makes the required calls to the WO.Vendor0.asp page
- This sample will show you how to create a multi page data entry screen. The first page
asks for a couple of input items. When you click "next", the partial data
will be submitted to the server (calling the same ASP file) and the data will be
validated. If valid, the next page is displayed. If not valid, the first page is
redisplayed with the errors properly marked.
- This shows you how you can quickly prototype a data entry screen and a report using the
AutoEntry and AutoReport capabilities of the WO. The entry screen is built using a single
WO function call that says "build a data entry page for each field in the file using
the DDs to determine how the page should look". The report is built using a single WO
function that says "Build a report for all fields in the file". Generally, this
type of automated entry is good for prototyping but not flexible enough for an actual
application. However, check out the results - they look pretty good.WML Pages
'More About WML (MoreWml.asp)' pageWml-Sample-1.wml page
- Explains hot to use Visual DataFlex Web Application Server with WAP devices using WML.
- Shows "Getting Started" information and lists other sources for writing WML applications.
- Lists WML sample pages and web objects (WOs) that are included in this sample application.
- Includes explanations of what each of the WML pages does.
Wml-Sample-2.wml page
- This creates a "Hello World" type of WML page.
Wml-Sample-3.wml page
- This sample was created to give you an idea of what a WML report might look like. This uses the WML <select> and <option> tags to create the report. You would rarely ever create a static page like this. Instead, you would use Visual DataFlex Web Application Server to generate a report like this dynamically (which is exactly what the WAP Report wizard does and is what the WAPCustList sample does).
Wml-Sample-4.wml page
- This sample was created to give you an idea of what a WML Display form might look like. Normally a page like this would be generated dynamically (which is exactly what the WAP Entry wizard does and is what the WAPCustList sample does). The results of that dynamic generation would look like this page.
Wml-Sample-5.wml page
- This sample was created to give you an idea of what a WML input form might look like. It uses the WML <input> tag to generate the input controls. Normally a page like this would be generated dynamically (which is exactly what the WAP Entry wizard does and is what the WAPCustList sample does). The results of that dynamic generation would look like this page.
WAPCustList.asp page
- Unlike the other samples, this uses an ASP page which dynamically creates the WML page. This sample was created by loading the WML template sample. It contains the basics of needed to build a dynamic WML page.
WAPCustomerMaint.asp page
- This ASP page is requested when you wish to display a list of customers. It is used to initialize the report (select the index), seed the report (determine which record to start at) and to generate the report, which is accomplished by making a call to the oWAPCustList WO.
- This sample is generated entirely by Visual DataFlex Web Application Server's WAP Report generation wizard. These components are used in conjunction with the entry components, WAPCustomerMaint.asp and WAPCustomerMaint.WO.
- This ASP page is requested when you wish to display, edit or delete customer data. The ASP page contains the presentation logic and the oWAPCustomerMaint WO is used to handle all business logic (find records, save new records, edit records, find records, delete records).
- This sample is generated entirely by Visual DataFlex Web Application Server's WAP Entry generation wizard. These components are used in conjunction with the report components, WAPCustList.asp and
WAPCustList