Page 289 - Open Soource Technologies 304.indd
P. 289
Unit 13: Working With Reports
13.5 Dynamic Data Binding
The ability to dynamically bind a data source to a data consumer is now possible in Visual Basic.
At run time, you can now set the DataSource property of a data consumer (such as the
DataGridcontrol) to a data source (such as the ADO Data control). This capability, unavailable
in previous versions of Visual Basic, allows you to create applications, which can access a
multitude of data sources.
13.5.1 Presenting Data to the End User
Visual Basic offers a variety of rich ways to present data to your end users. ADO/OLE DB-based
versions of all the data bound controls are included in Visual Basic:
• The DataList and DataCombo controls are the ADO/OLE DB equivalents of DBList and
DBCombo controls.
• The DataGrid is the successor to DBGrid.
• The Chart control is now data bound.
• A new version of the FlexGrid control, called the Hierarchical FlexGrid, supports the
hierarchical abilities of the Data Environment.
• The new DataRepeater control functions as a scrolling container of data bound user
controls where each control views a single record.
The Data Report is a new ActiveX designer that creates reports from any data source, including
the Data Environment. With the Data Report designer, formatted reports can be viewed online,
printed, or exported to text or HTML pages.
13.6 Data Formatting and Data Validation
The new Data Format object allows you to display data with custom formatting, but write it back
to the database in the native format. For example, you can now display dates in the format
appropriate to a country, while the actual data is stored in a date format. Data is formatted
coming out of the source, and unformatted going back in. You can also do custom formatting
and perform additional checks using the Format and Unformat events.
Data validation is also enhanced using the CausesValidation property with the Validate event.
By setting the CausesValidation property to True, the Validate event for the previous control in
the tab order will occur. Thus, by programming the Validate event, you can prevent a control
from losing focus until the information it contains has been validated.
13.6.1 Language Features
New data-related enhancements to the Visual Basic language include the ability to pass User-
defined Types (UDTs) and arrays across processes. You can now define a UDT and pass it as a
parameter to another process, such as an ActiveX EXE or DLL.
13.6.2 DHTML and Data Access
Using Visual Basic, you can create complete web applications for data access. All of the data tools
and technologies can also be used in DHTML pages, and on web server (IIS) applications.
LOVELY PROFESSIONAL UNIVERSITY 283