Feature List

Click on the links below to see details on where in the Visual DataFlex samples any particular technique or feature is used.

ActiveX Controls

Automation Control

Calendar Control

Internet Explorer Control

Media Player

Coding Styles

RowID

Hungarian Notation

Short Object Referencing & Object Neighborhoods

Database Operations

Auto Incrementing Numeric Ids

Custom Save & Delete Confirmations

Data File, Creating Dynamically

Database API Calls

DataFlex Table and Indexes, Creating Dynamically

dbGrid with Additional DEO Control to Display Extra Row Information

Dynamic Constraints

Embedded SQL Statements

Form View for Single Data File

Form View with Related Data Files

Form View with Related Tables and a Non-related "Suggestion" Data File

Simple Validation

Stored Procedures, Calling

Updating Order Totals (During Data Entry and Update/Backout)

Validating Data During Save

View with Child Table

Data-Aware Controls & Classes

cDbTextEdit

dbComboForm

dbEdit

dbForm

dbGrid

dbList with CheckBoxes

dbSpinForm

dbTabDialog

dbTabDialog with Images on Tabs

dbTabDialogView

Internet & Email

FTP: cFTPTransfer

MAPI

XML

Web and Web Services

Web-Based Data Entry

Web Reports

Web Services

Wireless Application Protocol (WAP)

WML

ASP/WO

Menus & Toolbars

Custom cToolbar

Custom Menus

Custom Floating Menus

Non-Data-Aware Controls & Classes

Array Object

cRichEdit

cTextEdit

CheckBox

Grid

ImageList

OpenDialog

Radio, RadioGroup

SaveAsDialog

SpinForm

TabDialog

TreeView

Reporting

BasicReport

Crystal Reports

Web Reports

WinPrint

Miscellaneous Topics

Anchors for Resizing Components

Business Process Object (BPO)

Combo in Grid

Embedded Resources

Errors

HTML Help

Library

Meta-Data Tags

OEM to Ansi Conversion

Passwords

Status Panel

Struct and Arrays

Workspace Selection

See Also

Learning from the Examples


ActiveX Controls

Automation Control

Workspace:

Specialized Components

Project:

COMSamples.src

Component:

fmSimpleController.vw – 'Simple Automation Control' view

Demonstrates how to connect to, exchange messages with, and disconnect from an automation control.

Calendar Control

Workspace:

Specialized Components

Project:

COMSamples.src

Component:

DateForm.vw – 'Date 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:

Specialized Components

Project:

COMSamples.src

Component:

Order.vw – 'Order Entry w/ Data Aware Calendar Contr' view

Demo of Order Entry View with embedded data-aware Calendar ActiveX control.

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – 'Contacts' view

It shows how dates in a grid can be selected from a Calendar ActiveX control.

Internet Explorer Control

Workspace:

Specialized Components

Project:

COMSamples.src

Component:

IE.vw – '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:

Web Services Clients

Project:

WebServicesClients.src

Component:

DailyDilbertCartoon.vw – 'Daily Dilbert Cartoon' view

The Daily Dilbert Cartoon view uses a browser object to display the image (Dilbert cartoon) returned from the web service call.

Media Player

Workspace:

Specialized Components

Project:

COMSamples.src

Component:

MediaPlayer.vw – '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.

See Also


Coding Styles

RowID

Workspace:

Specialized Components

Project:

Organization.src

Component:

Organization.vw – ‘Organization Treeview’ view

All data dictionary objects use RowId in their Request_Save methods.

The array object in this component has functions that use RowId as a parameter and a return value.

Workspace:

Order Entry

Project:

WebApp.src

Component:

The following web objects: Customer, CustomerReport, Invt, OrderDtlReport, OrderReport, SalesP, Vendor, and WapCustList.

The following asp pages: Customer, Customer0, Customer1, Customer2, Customer3, CustomerList, CustomerReport, CustomerReportZoom, Invt, InvtList, OrderDtlReport, OrderReport, SalesP, SalesPList, Vendor, Vendor0, VendorList, WapCustList, WapCustomerMaint, and Wml-Sample-5.

Hungarian Notation

Workspace:

Order Entry

Project:

Order.src; WebApp.src

Component:

All programs, views and other components.

All object, class, variable and property names in this sample use Hungarian notation.

Short Object Referencing & Object Neighborhoods

Workspace:

Order Entry

Project:

Order.src

Component:

All Windows 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.

See Also


Database Operations

Auto Incrementing Numeric Ids

Workspace:

Order Entry

Project:

Order.src; WebApp.src

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.

Custom Save & Delete Confirmations

Workspace:

Order Entry

Project:

Order.src

Component:

Order.vw – 'Order Entry' view

Custom save and delete confirmations are coded in these following functions in oOrderEntryView:

Function Confirm_Delete_Order

Function Confirm_Save_Order

Data File, Creating Dynamically

Workspace:

Specialized Components

Project:

DataDefinition.src

Component:

DataDefinition.src – 'Data Definition sample application' application

This sample application contains sample code that demonstrates how to maintain data files – dealing with indexes, adding/removing fields, changing field definitions, etc.

The “Data Definition in Visual DataFlex” white paper (http://www.dataaccess.com/whitepapers/datadefinitioninvdf5/data_definition_in_VDF.htm) has more details on what this sample covers.

Database API Calls

Workspace:

Specialized Components

Project:

DataDefinition.src

Component:

DataDefinition.src – 'Data Definition sample application' application

This sample application contains sample code that demonstrates how to maintain data files – dealing with indexes, adding/removing fields, changing field definitions, etc.

The “Data Definition in Visual DataFlex” white paper (http://www.dataaccess.com/whitepapers/datadefinitioninvdf5/data_definition_in_VDF.htm) has more details on what this sample covers.

DataFlex Table and Indexes, Creating Dynamically

Workspace:

Specialized Components

Project:

EmbSQLSample.src

Component:

CustByTotalOrdered.rv – '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.

dbGrid with Additional DEO Control to Display Extra Row Information

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – 'Contacts' view

The 'Call Notes' dbTextEdit has same server as the 'Call Detail' dbGrid. It shows notes for the currently active record in the 'Call Detail' dbGrid.

Dynamic Constraints

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – 'Contacts' view

Allows user to dynamically toggle constraint on or off using Radios.

Embedded SQL Statements

Workspace:

Specialized Components

Project:

EmbSQLSample.src

Component:

EmbSQLSample.src – 'Embedded SQL Sample Application' application

This sample application contains sample code that works with any Connectivity Kit that supports embedded SQL statements. Please read the “Using Embedded SQL” help topic for detailed information on this subject.

Form View for Single Data File

Workspace:

Order Entry

Project:

Order.src

Component:

Customer.vw – 'Customer Entry' view

SaleP.vw – 'Sales Person Entry' view

Vendor.vw – 'Vendor Entry' view

Form View with Related Data Files

Workspace:

Order Entry

Project:

Order.src

Component:

Invt.vw – 'Inventory Item' view

Form View with Related Data Files and a Non-Related "Suggestion" Data File

Workspace:

Wine Inventory

Project:

Wines.src

Component:

WinesEntry.vw – 'Wine Entry' view

Simple Validation

Workspace:

Order Entry

Project:

Order.src; WebApp.src

Component:

Vendor.dd – Vendor DataDictionary

Vendor DataDictionary uses simple validation for Vendor.State field.

Stored Procedures, Calling

Workspace:

Specialized Components

Project:

EmbSQLSample.src

Component:

StoredProcedureODBC.vw – 'Stored Procedure Sample (ODBC)' view

Demonstrates calling of a Stored Procedure via the ODBC Connectivity Kit.

Updating Order Totals (During Data Entry and Update/Backout)

Workspace:

Order Entry

Project:

Order.src; WebApp.src

Component:

OrderDtl.dd – 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

Validating Data During Save

Workspace:

Order Entry

Project:

Order.src; WebApp.src

Component:

Invt.dd – Inventory DataDictionary

Checks for inventory stock during Validate_Save.

View with Child Table

Workspace:

Order Entry

Project:

Order.src

Component:

Order.vw – '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:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – 'Contacts' view

Demonstrates two detail dbGrids from two separate child data files in header/detail scenario.

See Also


Data-Aware Controls & Classes

cDbTextEdit

Workspace:

Order Entry

Project:

Order.src

Component:

Customer.vw – 'Customer Entry' view

Workspace:

CodeMaintenance

Project:

CodeMaint.src

Component:

CodeTypeEntry.vw – 'Maintenance' view

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – 'Contacts' view

Workspace:

Order Entry

Project:

Order.src

Component:

Customer.vw – 'Customer Entry' view

Workspace:

Wine Inventory

Project:

Wines.src

Component:

WinesEntry.vw – 'Wines Entry' view

dbComboForm

Workspace:

Order Entry

Project:

Order.src

Component:

Order.vw – 'Order Entry' view

dbEdit

Workspace:

Order Entry

Project:

Order.src

Component:

Customer.vw – 'Customer Entry' view

dbEdit for Customer.Comments on Comments dbTabPage.

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – '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.

dbForm

Almost every sample application contains dbForms, the most frequently used data-aware control.

dbGrid

Workspace:

Order Entry

Project:

Order.src

Component:

Order.vw – 'Order Entry' view

See View with Child Table section

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – 'Contacts' view

See View with Child Table section

dbList with CheckBoxes

Workspace:

Wine Inventory

Project:

Wines.src

Component:

Wines.sl – 'Available Wines' Lookup

dbSpinForm

Workspace:

Order Entry

Project:

Order.src

Component:

Order.vw – 'Order Entry' view

dbTabDialog

Workspace:

Wine Inventory

Project:

Wines.src

Component:

WinesEntry.vw – 'Wine Entry' view

dbTabDialog with Images on Tabs

Workspace:

Wine Inventory

Project:

Wines.src

Component:

WinesEntry.vw – 'Wine Entry' view

dbTabDialogView

Workspace:

Wine Inventory

Project:

Wines.src

Component:

WineMaintenance.vw – 'Wine Maintenance' view

Uses dbTabDialogView with separate DDOs for each dbTabView.

See Also


Internet & Email

FTP: cFTPTransfer

Workspace:

Specialized Components

Project:

InetTransfers.src

Component:

InetTransfers.src – 'Internet FTP/HTTP Transfer' application

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.

MAPI

Workspace:

Specialized Components

Project:

MAPI.src

Component:

MAPI.src – 'MAPI Sample' application

Full MAPI sample application.

Includes modified Order Entry Customer Entry view with email enhancements.

Has 6 custom classes that are added to the Studio Controls Palette on MAPI tab page.

Workspace:

Specialized Components

Project:

ComposeMessage.src

Component:

ComposeMessage.src – 'Send a message without visual components' application

Shows how to send a MAPI email message without a user interface.

XML

Workspace:

Specialized Components

Project:

XML-Sample.src

Component:

XML-Sample.src – 'XML Sample' application

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:

Order Entry

Project:

WebApp.src

Component:

CustomerXML.wo – ‘Customer List using XML’ web service object

Generates an XML document listing all customers in the Customer table and returns an XML handle.

Process an XML document passed as an argument with customers marked for deletion and returns a new list of customers as an XML handle.

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

StockQuote.vw – 'Stock Quote' view

The view handles the return value from a Web Service call. This view handles XML returned in a string. and shows you how to traverse an XML document

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

CustomerXMLTransfer.vw – 'Customer Transfer' view

The view handles the return value from a Web Service call. In this example, the view deals with XML handles as the return value.

This view uses name space to get the values we need from the XML document.

See Also


Web and Web Services

Web-Based Data Entry

Workspace:

Order Entry

Project:

WebApp.src

Component:

Customer.asp, SalesP.asp, Vendor.asp. Invt.asp, Customer0.asp, Customer1.asp, Customer2.asp, Customer3.asp, Vendor0.asp

Web Reports

Workspace:

Order Entry

Project:

WebApp.src

Component:

CustomerReport.asp – 'List Customers' 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:

Order Entry

Project:

WebApp.src

Component:

OrderReport.asp – 'List Orders' page

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.

Workspace:

Order Entry

Project:

WebApp.src

Component:

VendorList.asp – 'Vendor Listing' page

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.

Workspace:

Order Entry

Project:

WebApp.src

Component:

InvtList.asp – 'Vendor Parts List' 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.

Web Services

Workspace:

Order Entry

Project:

WebApp.src

Component:

MoreWebservices.asp – 'More About Web Services' page

Explains the examples on web services.

It has links to display the WSDLs and to run the examples.

Workspace:

Order Entry

Project:

WebApp.src

Component:

CustomerXML.wo – 'Customer List using XML' web object

Demonstrates the usage of Web Services from a server perspective.

This object uses XML as the method to update the information in the customer table and produce a list with information from the customers table.

Workspace:

Order Entry

Project:

WebApp.src

Component:

CustomerAndOrderInfo.wo – 'Customer and Order Information' web object

Demonstrates the usage of Web Services from a server perspective.

Uses different structs and arrays and the WebServiceException message to signal to the client calling the functions that an error occurred.

Workspace:

Order Entry

Project:

WebApp.src

Component:

TestService.wo – 'Test Web Service' web object

Demonstrates the usage of Web Services from a server perspective.

This web object uses the WebServiceException message to signal to the client calling the functions that an error occurred.

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

All

Demonstrates the usage of Web Services from a client perspective.

Uses custom menu.

Uses Internet Explorer COM control, grid, cTextEdit, cRichEdit and other controls.

Handles XML returned from services in different forms.

Handles different structs and arrays returned from services.

Each view in this sample application uses a different web service that is either in Order Entry sample or freely available on the web, listed on XMethods (http://www.xmethods.com).

See Also


Wireless Application Protocol (WAP)

WML

Workspace:

Order Entry

Project:

WebApp.src

Component:

MoreWml.asp – 'More About 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.

Workspace:

Order Entry

Project:

WebApp.src

Component:

Wml-Sample-1.wml page

This creates a "Hello World" type of WML page.

Workspace:

Order Entry

Project:

WebApp.src

Component:

Wml-Sample-2.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).

Workspace:

Order Entry

Project:

WebApp.src

Component:

Wml-Sample-3.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.

Workspace:

Order Entry

Project:

WebApp.src

Component:

Wml-Sample-4.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.

Workspace:

Order Entry

Project:

WebApp.src

Component:

Wml-Sample-5.wml 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.

ASP/WO

Workspace:

Order Entry

Project:

WebApp.src

Component:

WAPCustList.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.

Workspace:

Order Entry

Project:

WebApp.src

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.

See Also


Menus & Toolbars

Custom cToolbar

Workspace:

Specialized Components

Project:

RichEditApp.src

Component:

RichEditComponentToolbar.pkg

Custom toolbar used to format text in a cRichEdit control. DFBaseEditPullDown is used in a dropdown menu for Numbering options.

Workspace:

Order Entry

Project:

Order.src

Component:

OrderToolbar.pkg

Custom toolbar with popup menu (DFBaseEditPullDown) for views.

Custom Menus

Workspace:

Specialized Components

Project:

Mapi.src

Component:

Mapi.mn

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.mn

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

WebServicesClient.mn

Workspace:

Wine Inventory

Project:

Wines.src

Component:

Wines.mn

Custom Floating Menus

Workspace:

Specialized Components

Project:

RicheEditApp.src

Component:

RichEditView.vw – 'RichEdit Control' view

This view contains a floating menu that is displayed when right-clicking on the cRichEdit control.

The options in the menu are: Undo, Redo, Cut, Copy, Paste, and Select All.

See Also


Non-Data-Aware Controls & Classes

Array Object

Workspace:

Specialized Components

Project:

Organization.src

Component:

Organization.vw – 'Organization TreeView' view

Uses an Array object to save the elements displayed in its TreeView.

cRichEdit

Workspace:

Specialized Components

Project:

Mapi.src

Component:

ReadMail.dg – 'Read Email dialog'

Shows how OnLinkClicked event can be used in order to have the shell handling the link.

Workspace:

Specialized Components

Project:

RichEditApp.src

Component:

RichEditView.vw – 'RichEdit Control' view

Loads and saves RTF files.

Demonstrates how to format text displayed in the control using shortcut keys and toolbar buttons.

Shows how to find and replace text using methods available in the cRichEdit class.

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

CustomerServices.vw – 'Quote Items and Display Orders' view

This view uses a cRichEdit object to display details of a selected order.

cTextEdit

Workspace:

Specialized Components

Project:

EmbSQLSample.src

Component:

StpredProcedureODBC.vw – 'Stored Procedure Sample (ODBC)', and Chapter3ODBC.vw – 'User's Guide Chapter 3 Sample (ODBC)' views

CustByTotalOrdered.rv – 'Customer by total amount ordered', CustOrderedAboveAvg.rv – 'Customers who ordered above average', and EmbSqlQry.rv –'Embedded SQL Query' report views

Workspace:

Specialized Components

Project:

Mapi.src

Component:

SendMail.dg – 'Send New Email dialog'

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

StockQuote.vw – 'Stock Quote', CustomerXMLTransfer.vw – 'Customer Transfer', CustomerInformation.vw – 'Read and Update Customer Data', and TranslateToMorseCode.vw – 'Translate To Morse Code' views

Each view uses various cTextEdit controls for different purposes: extra information, data entry and display of return values.

The views have examples on how to add text to the control and move content from one edit control to the other.

CheckBox

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

All

All views use a checkbox to generate or not web services debug information – details on the return value of the services called.

Grid

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

CustomerXMLTransfer.vw – 'Customer Transfer ' view

This view uses checkboxes in the grid.

The grid is populated with data returned from a web service call.

It also demonstrates how to remove selected lines from a grid after it has been populated.

ImageList

Workspace:

Specialized Components

Project:

RichEditApp.src

Component:

RichEditView.vw – 'RichEdit Control' view

Uses ImageList in its toolbar (RichEditComponentToolbar.pkg) to display images on buttons.

Workspace:

Specialized Components

Project:

Organization.src

Component:

Organization.vw – 'Organization TreeView' view

Uses ImageList in its TreeView control.

Workspace:

Wine Inventory

Project:

Wines.src

Component:

WinesEntry.vw – 'Wines Entry' view

ImageList for icons to use on tab buttons of dbTabPages.

OpenDialog

Workspace:

Specialized Components

Project:

InetTransfers.src

Component:

UploadFTPFile.vw – 'Upload File to FTP Server' view

Workspace:

Specialized Components

Project:

RichEditApp.src

Component:

RichEditView.vw – 'RichEdit Control' view

Radio, RadioGroup

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – 'Contacts' view

Most reports use Radios and RadioGroups for selection criteria. See the Reporting section for details.

SpinForm

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

CustomerServices.vw – 'Quote Items and Display Orders' view

This view gets the number of items to quote and uses the function DoCorrectValueToMinMaxValues to adjust the quantity to the range allowed.

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

CustomerInformation.vw – 'Read and Update Customer Data' view

This view gets the customer number typed in the SpinForm and uses the procedure OnChange of the SpinForm to display the Customer name in a Textbox object.

SaveAsDialog

Workspace:

Specialized Components

Project:

InetTransfers.src

Component:

DownloadFTP.vw – 'Download File from FTP Server' view

TabDialog

Workspace:

Contact Management

Project:

Contacts.src

Component:

ImpCont.rv – 'Contacts Maintenance' report view

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

CustomerServices.vw – 'Quote Items and Display Orders', and CustomerInformation.vw – 'Read and Update Customer Data' views

These views use TabDialogs to display related information organized in different pages.

TreeView

Workspace:

Specialized Components

Project:

Organization.src

Component:

Organization.vw – 'Organization TreeView' view

Demonstrates a database-connected TreeView.

Most methods have elaborate comments explaining what they do.

See Also


Reporting

BasicReport

Workspace:

Order Entry

Project:

Order.src

Component:

CustomerListBR.rv – 'Customer List' report view

This report is based on the BasicReport class. It uses selection criteria for output to screen or printer and ordering by customer number or name (using Radios in a RadioGroup).

Crystal Reports

Workspace:

Order Entry

Project:

Order.src

Component:

AddressLabelsCR.rv – 'Address Labels' report view

This report is based on the cCrystal class. It uses Crystal Data Object (CDO) to select the data used in the report and includes a parameter object to the report to filter the records that will be printed.

Workspace:

Order Entry

Project:

Order.src

Component:

CustomerListCR.rv – 'Customer List' report view

Very complex Crystal Reports sample report view.

This report is based on the cCrystal class. It 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", "Adobe PDF", "Excel 5.0", "Rich Text Format", "Text", "Record Style", "Comma Separated", "Data Interchange Format (DIF)").

Workspace:

Order Entry

Project:

Order.src

Component:

OrdersCR.rv – 'Orders' report view

This report is based on the cCrystal class. It uses selection criteria for output to screen or printer (using Radios in a RadioGroup).

Workspace:

Order Entry

Project:

Order.src

Component:

OrdersbyCustomerCR.rv – 'Orders by Customer' report view

This report is based on the cCrystal class. It uses selection criteria for choosing to print detail or summary (using Radios in a RadioGroup).

Workspace:

Order Entry

Project:

Order.src

Component:

ReportInformationCR.rv and ReportPreviewCR.rv

These are 2 ReportViews that show how to use some of the functions available in the class to get information stored in the reports and run the reports from Visual DataFlex. They are based on the cCrystal class.

Report Information - allows dynamic choosing of any Crystal Reports report and displays the report’s Selections, Sort Order and Formulas. You can also run the report from there.

Report Preview - allows dynamic choosing, running, previewing in a DataFlex container (using the cCrystalActiveXReportViewer class), resizing and exporting of any Crystal Reports report.

Workspace:

Order Entry

Project:

Order.src

Component:

CheckForCrystal.dg – ‘Crystal Report Test Information’ view

In order to be able to run Crystal Reports reports, you need to have certain files in place. This view shows an example on how to check the environment when Crystal Reports is used and verify that the necessary files are present.

This dialog is used by all Crystal Reports report views in this example.

Workspace:

Wine Inventory

Project:

Wines.src

Component:

WineInventoryLists.rv – 'Wine Inventory 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.

Web Reports

Workspace:

Order Entry

Project:

WebApp.src

Component:

CustomerReport.asp – 'List Customers' 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:

Order Entry

Project:

WebApp.src

Component:

OrderReport.asp – 'List Orders' page

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.

Workspace:

Order Entry

Project:

WebApp.src

Component:

VendorList.asp – 'Vendor Listing' page

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.

Workspace:

Order Entry

Project:

WebApp.src

Component:

InvtList.asp – 'Vendor Parts List' 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.

WinPrint

Workspace:

Order Entry

Project:

Order.src

Component:

CustomerListWP.rv – 'Customer List' report view

Shows how to generate a simple report with no breakpoints.

Determines ordering at runtime.

Forces a printer setting (landscape/portrait).

Prints text fields in a report.

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:

Order Entry

Project:

Order.src

Component:

ItemsPerOrderWP.rv – 'Items per Order' report view

Standard report with breakpoints, sub-headers, sub-totals and totals.

Workspace:

Order Entry

Project:

Order.src

Component:

OrdersByCustomerWP.rv – 'Orders by Customer' report view

Creates a nested/top down report with three nesting levels.

The outer report's ordering can be determined at runtime.

More complex use of sub-headers, subtotals and totals.

Forces a page break in a sub-total.

Workspace:

Order Entry

Project:

Order.src

Component:

OrdersWP.rv – 'Orders by Order Number' report view

Standard report with breakpoints, sub-headers, sub-totals and totals.

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contact_List.rv – 'Contact List (from Wizard)' report view

This is a sample view created using the Studio Report Wizard and adjusted for specific formatting.

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:

Contact Management

Project:

Contacts.src

Component:

Contact_Summary.rv – '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:

Contact Management

Project:

Contacts.src

Component:

Contact_Detail.rv – '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).

See Also


Miscellaneous Topics

Anchors for Resizing Components

Workspace:

Order Entry

Project:

Order.src

Component:

All Windows programs, views and other components

Most components in this sample are resizable via anchors as appropriate.

Business Process Object (BPO)

Workspace:

Contact Management

Project:

Contacts.src

Component:

ImpCont.rv – '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:

Specialized Components

Project:

XML-Sample.src

Component:

XML-2.vw – 'Basic XML 2' view

Writes data from a DDO to an XML document using BPO.

Workspace:

Specialized Components

Project:

XML-Sample.src

Component:

XML-3.vw – 'Basic XML 3' view

Reads XML document created in Basic XML 2 using BPO.

Workspace:

Specialized Components

Project:

XML-Sample.src

Component:

XML-4.vw – 'Basic XML 4' view

Writes data from one or multiple data files to an XML document using 3 different BPOs.

Combo in Grid

Workspace:

Contact Management

Project:

Contacts.src

Component:

Contacts.vw – 'Contacts' view

The grid where phone numbers are displayed uses combo box to display the descriptions that can be assigned to each phone number.

Embedded Resources

Workspace:

Order Entry

Project:

Order.src

Component:

Order.src – 'Order Entry Sample Application' Windows application

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:

Wine Inventory

Project:

Wines.src

Component:

Wines.src – 'Wines Sample Application' Windows application

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).

Errors

Workspace:

Order Entry

Project:

Order.src

Component:

Order.vw – 'Order Entry' view

Generic Errors: Specific error numbers in code were replaced with generic errors.

See Function Save_Header in oOrderEntryView.

Workspace:

Order Entry

Project:

WebApp.src

Component:

CustomerAndOrderInfo.wo – 'Customer and Order Information' and TestService.wo – 'Test Web Service' web objects

These web objects have functions that use the WebServiceException message as a way of communicating failure to the client calling the function.

HTML Help

Workspace:

All

Project:

All Windows projects

Component:

All Windows applications.

The class cHTMLHelp is used in the applications to bring up help on using the examples.

Library

Workspace:

Example Library

Component:

Workspace

This workspace is a library workspace that contains packages to be shared with other workspaces.

All packages from this workspace will be available when “Examples Library” is added to a workspace as a library. This means that the changes made in the packages will be visible to all workspaces that use “Examples Library”.

Workspace:

Contact Management

Component:

Workspace

This is an example of a workspace that uses source available through a library workspace.

Workspace:

Specialized Components

Component:

Workspace

This is an example of a workspace that uses source available through a library workspace.

Meta-Data Tag

Workspace:

Order Entry

Project:

WebApp.src

Component:

Customer.wo – ‘Customer: Entry, Report and Maintenance’, CustomerAndOrderInfo.wo – ‘Customer and Order Information Service’ , and CustomerXML.wo – ‘Customer List using XML’ web service objects

CustomerReport.wo – ‘Customer Information Drill Down Report’ web browser object

Uses Object Member Meta-Data Tags to define whether the objects are published or not.

Workspace:

Code Maintenance

Project:

CodeMaint.src

Component:

CodeMaInt.src – ‘Code Maintenance’ application

Uses Class Member Meta-Data Tags to define how the Studio handles the specified class members.

Workspace:

Example Library

Project:

Test.src

Component:

cComCalendar.pkg – ‘Calendar Control’ class and cComWebBrowser.pkg – ‘Web Browser Control’ class

Uses Class Member Meta-Data Tags to define how the Studio handles the specified class members.

Workspace:

Example Library

Project:

Test.src

Component:

cComMediaPlayer.pkg – ‘Windows Media Player’ class

Uses Class Meta-Data Tags to define how the Studio handles the specified class.

Workspace:

Specialized Components

Project:

Mapi.src

Component:

cAttachFilesGrid.pkg – ‘Grid Floater’, cDisplayOnlyForm.pkg – ‘Special Form’, cEntryGrid.pkg – ‘Special Grid’ and cReadOnlyGrid.pkg – ‘Read-Only Grid’ classes

Uses Class Meta-Data Tags to define how the Studio handles the specified class.

OEM to Ansi Conversion

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.

Passwords

Workspace:

Specialized Components

Project:

InetTransfers.src

Component:

UploadFTP.vw – '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:

Order Entry

Project:

WebApp.src

Component:

Login.asp – 'Login' 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).

Status Panel

Workspace:

Specialized Components

Project:

DataDefinition.src

Component:

All

The views in this workspace show how to use the StatusPanel object as well as the Callback method to show progress while performing long operations.

Workspace:

Specialized Components

Project:

InetTransfers.src

Component:

DownloadFTP.vw – 'Download File from FTP Server' and UploadFTP.vw – 'Upload File to FTP Server' views

These views use the StatusPanel object to show progress when downloading or uploading files.

Struct and Arrays

Workspace:

Order Entry

Project:

WebApp.src

Component:

CustomerAndOrderInfo.wo – 'Customer and Order Information' web object

This object contains functions published as web services that receive and return arrays and structs.

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

CustomerServices.vw – 'Quote Items and Display Orders' view

This view uses arrays of simple data type and of structs to display orders and customer information.

Workspace:

Web Services Clients

Project:

WebServicesClients.src

Component:

CustomerInformation.vw – 'Read and Update Customer Data' view

This view uses arrays of structs to list, display and update customer information, and to save a new customer to the Customer table at the server.

Workspace Selection

Workspace:

Specialized Components

Project:

DataDefinition.src

Component:

DataDefinition.src – 'Data Definition' application

This project shows how to open .sws files to select a workspace.

Workspace:

Specialized Components

Project:

DataDefinition.src

Component:

Reindex.rv – ‘Reindex Sample’ report view

This report view show how to open .sws files to select a workspace and display the current selected workspace.

Workspace:

Specialized Components

Project:

DataDefinition.src

Component:

Resize01.rv – ‘Resize Sample 1’ report view

This report view show how to open .sws files to select a workspace and display the current selected workspace.

Workspace:

Specialized Components

Project:

DataDefinition.src

Component:

Resize02.rv – ‘Resize Sample 2 / Sentinel’ report view

This report view show how to open .sws files to select a workspace and display the current selected workspace.

Workspace:

Specialized Components

Project:

DataDefinition.src

Component:

Resize03.rv – ‘Resize Sample 3 / Progress sentinel’ report view

This report view show how to open .sws files to select a workspace and display the current selected workspace.

See Also


Learning from the Examples

Visual DataFlex combines Windows, Web and Web Service application development into one environment. Sample applications are provided with the product for each of these application types. The sample applications demonstrate many useful features and methods that developers want to incorporate into their applications. We'll tell you where in the samples specific features and techniques are used.

We'll break down the samples by the features used and point you to the places in the samples that the feature is demonstrated. Each section is divided into sub-topics that discuss where a particular feature is shown in specific samples.

Categories

ActiveX Controls

Coding Styles

Database Operations

Data-Aware Controls

Internet & Email

Web and Web Services

Wireless Application Protocol (WAP)

Menus and Toolbars

Non-Data-Aware Controls & Classes

Reporting

Miscellaneous Topics

Note

Each sub-topic starts with an entry like this showing you how to access the example:

Workspace:

Order Entry

Project:

Order.src

Component:

Customer.vw – ‘Customer Entry’ view

Where...

  • Workspace: is the workspace name: open in Visual DataFlex Studio using File > Open Workspace

  • Project: is the project name: open in Visual DataFlex Studio using Workspace Explorer combobox

  • Component: is the component name and description: open in Visual DataFlex Studio using File > Open File(s)

  • 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).