What Are the Office Web Components?
The Office Web Components are a t of Component Object Model (COM) controls designed to bring interactive spreadsheet modeling, databa reporting, and data visualization to a number of control containers. The OWC library contains four principal components: Spreadsheet, Chart, PivotTable, and Data Source. We'll discuss each of the controls briefly in this ction and in much more detail in the following chapters.
美林谷滑雪场NOTE
COM is also known as ActiveX. I was on the Visual Basic team when Microsoft invented the term "ActiveX" to describe the COM technologies, throwing most of our customers for a loop since they had just gotten ud to saying COM after we stopped using the term "OLE." Since I'm not a marketing person, I'll just u the term COM in this book to describe the Component Object Model technologies.
The word "Office" in the name "Office Web Components" indicates that the controls were developed by some of the same programmers who created Microsoft Excel and Microsoft Access and that the controls were made to look, feel, and behave like small versions of their Microsoft Office siblings. The controls definitely don't have all the features found in Excel and Access—in other words, you wo
物流运输合同范本uldn't want to dynamically download all of Excel and Access to view a report in your browr! However, the controls do contain many of the commonly ud features, especially tho needed when interacting with content that's already been created. Plus, they can read and write the HTML file format of Excel 2000, allowing the ur to click a button and load the current data into Excel for more powerful analysis. In this book, I'll detail the noteworthy Excel or Access features that are and aren't supported by each component. I'll also show you how to add some of the missing features with your own code.
The "Web" part of OWC's name is often misleading. The controls are standard COM controls and can be ud in many control containers such as Microsoft Internet Explorer, Microsoft Visual Basic, Microsoft Visual C++, Microsoft Visual FoxPro, or Microsoft Office UrForms. However, the controls have a few behaviors that make them especially suited to the unique environment of Internet Explorer. For example,
web browrs automatically support scrolling along a document, and it's often annoying for a control in the page to have its own t of scroll bars. The Spreadsheet and PivotTable controls can be t to automatically adjust themlves to fit their current content without requiring internal scroll bars. Also, all the controls support the color names available in Internet Explorer in addition to supporting numer
ic RGB values. That means you can t the background color of an element to "CornSilk" or "PapayaWhip" (my personal favorite), and the control will convert the color to the appropriate RGB value just as Internet Explorer would.
The "Components" part of OWC's name is a touch confusing, although it's more accurate than using the word "Controls" (though I will often refer to OWC as "controls" for convenience throughout this book). The Office Web Components are unusual in that they can be ud in control containers like web pages, Visual Basic forms, and so on, as well as in memory as invisible objects. Most COM controls can be ud only as visible controls in control containers, and most invisible objects, such as tho accesd via the Microsoft ActiveX Data Objects (ADO) interface, can be ud only in memory and cannot be put on a form or web page. The OWC library was built so that its components could be ud either way, which enables you to u the controls with the ur interfaces they expo or for their ba rvices, such as spreadsheet recalculation. The ability to u the components as invisible objects also enables you to u the library on a rver to easily generate static content that urs can view in any web browr (more on that later in the chapter).
All the controls support a rich t of programming interfaces that you can call from Microsoft VBScript (Visual Basic Scripting Edition), Microsoft JScript, Microsoft VBA (Visual Basic for Applicati
ons), Java, C++, and any other language capable of calling a dual or dispatch COM interface. That means you can weave the components into a custom solution and make them look and act the way you want. I will discuss most of the important properties, methods, and events in the subquent chapters and will cover many more of the in the chapters describing the various solutions found on the companion CD.
SEE ALSO
If you are looking for a definitive reference on COM, I'd recommend picking up a copy of David Chappell's Understanding ActiveX and OLE (Microsoft Press, 1996).
Let's take a brief look at each of the components and discuss what kinds of solutions you can build with them. As already mentioned, the next four chapters will cover each component in more depth.
The Spreadsheet Component
The Spreadsheet component (shown in Figure 1-1) is like a small version of an Excel spreadsheet, complete with a spreadsheet ur interface and a recalculation engine that supports nearly all the calculation functions in Excel 2000. With this control, you can change or recalculate values; sort, filte
r, and scroll data; protect cells; and even reload the data into Excel 2000 for further manipulation. The Spreadsheet control can load its data from an embedded parameter or from any URL that points to an Excel spreadsheet saved in HTML file format.
Figure 1-1.The Spreadsheet component.
The Spreadsheet control is uful anytime you want to make a spreadsheet model available on your intranet so that others can change the input and instantly view the recalculated results. Examples include a mortgage calculator and payment schedule model, a product break-even model, and a sales forecasting model.
This control is also uful for any kind of cross-tabulated or grid-bad data entry, especially when you need to u formulas with automatic recalculation. Examples include expen reports, timesheets, and budgets.
The Spreadsheet control has the ability to bind cells to properties of other objects on the page and then automatically update the cell and its dependents when the source indicates that the property value has changed. This makes it possible to feed real-time data into the spreadsheet for scenarios such as a stock portfolio.高中地理答题模板
The Spreadsheet control is specifically designed to keep listening for new values and recalculating even when you are editing other formulas or formatting other cells in the spreadsheet you're working on.
The Chart Component做图片
The Chart component (shown in Figure 1-2) is comparable to a small version of Excel charting, supporting most of the two-dimensional chart types in Excel 2000 as well as a Polar chart type. Another big feature is that the Chart control can display many plots at once, allowing you to create a small-multiple design—in other words, a collection of plots that vary by one property and can be compared at a glance. A chart can be data-bound to the Spreadsheet control, the PivotTable control, or an ADO Recordt object, or it can be filled with literal data values. When bound to a data source, a Chart control will update whenever the source data changes.
SEE ALSO
For more information on the power of small-multiple designs, e Edward Tufte's book Envisioning Information (Graphics Press, 1990).
Figure 1-2.The Chart component.
The Chart control is primarily uful any time you need to chart live data or monitor a specific metric critical to your business. Becau it supports a rich programming model, you can also add many effects to a chart with this control, such as zooming and panning on large axes, dynamically changing other content in the application bad on the mou's location, or letting urs double-click to link to a new page displaying more information about the lected data point.
The PivotTable Component
Designed to deliver interactive data reporting and analysis, the PivotTable component (shown in Figure 1-3) provides all the functionality found in Excel PivotTables and external data ranges. It can retrieve data from tabular, relational databas through OLE DB, as well as from OLAP rver cubes and cube files through OLE DB for OLAP. Using this control, you can view data grouped, sliced, and sorted in a variety of ways, creating polished reports and interactive analysis on live data.
左耳朵
一个夭一个山You can u this control for many tasks, although it's best suited for databa reporting and data analysis solutions. When bound to an OLAP cube, the PivotTable control can provide the ur with a flexible, high-performing analysis surface. IT groups can concentrate on collecting and cleaning data and loading it into cubes that犬智商排名
吃百香果的好处
reflect the way their company thinks about the data, while urs working with this control can create slices of the data to fit their own needs.
Figure 1-3.The PivotTable component.
The PivotTable control can also perform the same operations directly on a relational databa, so you can u it even if you don't have an investment in an OLAP system. However, the performance when using an OLAP data source is always much faster becau of the nature of the technology. OLAP has other logical benefits that we'll discuss further when we explore the Sales Analysis and Reporting solution in Chapter 7.
The Data Source Component
The Data Source component (DSC) is the backbone for controls that require data from external sources. Although this control is invisible, it is widely ud to retrieve data, manipulate data into hierarchies or temporary OLAP cubes (more on this in Chapter 4), and establish data bindings between the various controls. Since the DSC supports the same standard interfaces as other data source controls found in Internet Explorer and Visual Basic, it will interoperate in tho environments. The DSC is ud heavily in Access 2000's data access pages feature and encapsulat
es much of the functionality found in the Access reporting engine.
The DSC is involved almost any time the other components retrieve data from an external databa. However, it also supports a programming model of its own, and you can u it to build or manipulate hierarchical Recordt objects. In general, you don't need to think much about the DSC since the other components and the Access 2000 Data Access Page Designer will t it up and implement it for you.