In the Real WorldA Hobson s Choice: MSGraph Objects Versus PivotCharts

In the Real World A Hobson's Choice: MSGraph Objects Versus PivotCharts

graphics/globe.gif

Webster's New Collegiate Dictionary defines a Hobson's choice as an "apparently free choice with no real alternative." You are free to continue to use MSGraph with Jet databases and Jet SQL crosstab queries. MSGraph is a mature and stable product with no significant bugs. Its precursors date back to Excel 5.0, and MSGraph is backward-compatible with the Access 97, 2000, and 2002 versions. If you intend to use VBA to customize MSGraph objects, however, be prepared for a long learning curve. MSGraph's object model is the epitome of obfuscation. Check http://msdn.microsoft.com/library/officedev/odeomg/deovrmicrosoftgraph2000.htm for an object model diagram of MSGraph 9.0. Compare the MSGraph object model with the PivotChart object model at http://msdn.microsoft.com/library/en-us/owcvba10/html/octocChartWorkspaceObjectModel.asp.

General-purpose OLE 2.0 objects created by mini-servers, such as MSGraph, are endangered species because Web browsers, including IE, don't support them directly. You can open a Word document or Excel spreadsheet in IE and display an embedded MSGraph chart because Word and Excel are OLE 2.0 full servers and act as the graph's container. The catch is that you must have Microsoft Office installed to open the Word or Excel document, plus MSGraph (which Office installs automatically) to view the embedded graph or chart. The Access 2003 runtime version includes a redistributable runtime version of Graph.exe; the runtime version's design features are disabled.

PivotCharts and their underlying PivotTables are ActiveX controls, so they're Web-enabled and programmable with VBScript or JavaScript, as well as with VBA when they're used in conventional Access forms and reports. The hierarchy of the PivotChart object model is much simpler and more straightforward than that of MSGraph. PivotTables accept XML-encoded data, so they fit into Microsoft's .NET framework. PivotTables and thus PivotCharts also can manipulate DataCubes generated by SQL Server's Analysis (OLAP) Services. You can expect Microsoft to enhance these versatile controls in subsequent Office upgrades. MSGraph is in maintenance mode and Microsoft provides it only for backward compatibility; there won't be any additions to its current feature set or changes to its object model.

graphics/2002_icon.gif

Office 2000's license restrictions on Office Web Components (OWC) 9.0 prevented Access developers from using PivotCharts and PivotTables in runtime Access applications. (MOD10 includes the runtime versions of both MSAccess.exe and MSGraph.exe). OWC version 9.0 required users to have Office 2000 installed to open a form or report containing a PivotTable or PivotChart. Office XP changed the licensing terms. The Office 2003 OWC license lets you distribute OWC 11.0 with your runtime applications for users who don't have Office 11 installed. This policy is similar to that for Graph.exe. Alternatively, users of Web-enabled Access applications can download the OWC from Microsoft's Web site; the download is automatic if OWC11.dll isn't present and registered on the user's computer.

The only difference between the licensed and distributable behavior of OWC 11.0 is lack of design-mode features in the latter. For instance, users can't alter the field complement of PivotTables or perform pivoting operations, but expansion/contraction and setting filters are permitted. This is more of an issue with PivotTables than with PivotCharts; most applications set the properties of PivotCharts either in the Properties dialog for the object or with VBA code.

There's no "real alternative" to PivotCharts in the new Access 11 applications you create or, as mentioned early in the chapter, for existing applications you upgrade to ADP and SQL Server. The workaround for the lack of SQL Server crosstab queries described in Chapter 22's "Emulating Jet Crosstab Queries with T-SQL" section is a short-term approach. Dedicate your graph and chart learning investment to PivotCharts; MSGraph is a dead end.



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

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