Overview

[Previous] [Next]

As you have learned, the Office Web Components were designed to encapsulate the data analysis and reporting functionality of Microsoft Excel and Access. The other three Office Web Components have fairly direct analogs: the Spreadsheet component encapsulates Excel's basic spreadsheet and recalculation services, the Chart component encapsulates the basics of Excel charting, and the PivotTable component encapsulates both the PivotTable and QueryTable features in Excel. The DSC also has a direct analog, although you might not recognize it immediately.

Behind each bound Access form or report, a fairly large chunk of code performs the rather unglamorous job of retrieving data, synchronizing user interface controls with the data (or binding the controls), and maintaining the notion of a current row. Often the form or report has a hierarchical shape. For example, an order entry form collects information for the entire order, and a subform collects one or more detail rows for each order. Another example is a sales report that groups the data by several levels, showing sales broken down first by month, then by customer region, and then by salesperson. Both the order form and the sales report have a hierarchical data structure: the order form has a one-to-many relationship, and the sales report contains detail data grouped by three levels. The order entry form has a set of rows for the order header information, and each row contains a subset of rows for the individual order detail information. The sales report begins with a row for each month. Each month has a subset of rows for each distinct customer region, each customer region has a subset of rows for each distinct salesperson, and each salesperson has the detail data for the sales transactions in that particular time/region/salesperson group.

The DSC encapsulates all the feature sets just described: it retrieves data, binds controls, and manages row currency. It also exposes mechanisms to define a hierarchical data model and generate the appropriate commands to produce a hierarchical Recordset at runtime. The Data Access Page Designer manipulates the DSC extensively at design time, defining the hierarchical data model based on the placement of fields on the design surface. At runtime, the DSC generates a command grammar known as the shape syntax, which gets interpreted by the Data Shape Provider, an OLE DB service provider that builds hierarchical Rowsets from related Rowsets returned by the actual data provider. Figure 5-1 shows the data access architecture used by the DSC.

The DSC encapsulates one additional service provided by the code behind Access reports and continuous forms. When designing an Access report, you place fields and other unbound elements into sections known as bands to define the visual template for a row in a particular section. A continuous form is like a report with one detail section. At runtime, the code behind the report or continuous form replicates an instance of the visual template for each row in the section, binding the controls in each instance to their corresponding data row. The DSC provides this same functionality to the world of HTML pages in Microsoft Internet Explorer. By employing services in Internet Explorer, the DSC can use a visual template defined in the Data Access Page Designer to replicate an instance of the template for each data row.

click to view at full size.

Figure 5-1. The DSC's data access architecture.

Since the DSC is a data source for other controls, it implements the standard COM interface for data source controls, known as IDataSource. This interface is recognized in Microsoft Visual Basic as well as in Internet Explorer, enabling the DSC to automatically participate in those environments' standard data-binding mechanisms. For example, if you place the DSC on a Visual Basic form, the form will recognize that the DSC is a potential data source and display it in the DataSource property drop-down list of each data-consuming control.

The DSC is invisible at runtime, meaning that it does not display a user interface at runtime. At design time, it appears as a small square image that looks—not surprisingly—like the Access key icon with a database icon behind it. This design-time display allows you to select the control, set its top-level properties, or delete it. The control's placement is not important because it does not take up any room at runtime.



Programming Microsoft Office 2000 Web Components
Programming Microsoft Office 2000 Web Components (Microsoft Progamming Series)
ISBN: 073560794X
EAN: 2147483647
Year: 1999
Pages: 111
Authors: Dave Stearns

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net