Programming Microsoft Office 2000 Web Components Chapter 1

zhaozj2021-02-16  56

Translator's description: Welcome everyone to visit my blog: http://daidaoke.donews.net/daidaoke/

My email: tangtaike@163.com

For reprint, please notify us in advance.

Chapter 1 2 of Office Web Components?

Office Web Components is a set of COM controls, the purpose of design is to provide interactive spreadsheet modeling, data reports, and data visualization functions for numerous control containers. The OWC library contains four main components: spreadsheet components, chart components, perspective table components, and data source components. We will briefly discuss each control in this section and discuss more details in subsequent chapters.

Note:

COM is also known as ActiveX. When Microsoft invented the term "ActiveX" to describe COM technology, I am in the Visual Basic team, this term makes us surprised our customers, because these customers have just used to use the term COM after we stop using the term "ole". I am not market staff, so I only use the term COM to describe the component object model technology.

The word "office" in the "Office Web Components" name indicates that these controls are developed by some people developing Microsoft Excel and Access programmers, and these controls are designed to be in appearance, feelings and behaviors. It is the same as their Microsoft Office Brothers. These controls do not contain all the features in Excel and Access - in other words, you will not download the full Excel and Access to download a report in your browser. However, these controls have virtually included a number of common functions, especially those necessary to interact with existing content. In addition, these controls can also read and write files in the HTML format of Excel 2000, allowing users to click on a button to load the current data into Excel to make more powerful analysis. In this book, I will detail the significant features of these support and unsupported Excel and Access in each component. You will also show you how to use your code to add some of these controls.

The "Web" section in the OWC name is often misunderstood. These controls are standard COM controls and can be used in many control containers, such as Microsoft Internet Explorer, Microsoft Visual Basic, Microsoft Visual C , Microsoft Visual FoxPro, and Microsoft Office User Forms. However, some behaviors of these controls make them particularly suitable for use in the special environment of Internet Explorer. For example, a web browser provides an automatic scroll bar for documents, but people often worry about the controls of a group of scroll bars. The spreadsheet controls and data perspective controls are capable of fitting, automatically adjusting the size to fit their current content without requiring internal scroll bars. In addition, all controls support the color name available in Internet Explorer, but also support digital RGB values. This means that you can use "Cornsilk" or "Papayaw" (I personal hobby) element to set the background color, the control converts the color into an appropriate RGB value like Internet Explorer as the INTERNET Explorer.

Although the "Components" section in the OWC name is more accurate than using the word "controls" (although I will refer to OWC as "controls"), it is also quite confusing. The difference between Office Web Components is that they can use in a similar web page, Visual Basic Form, and the like, which can be used in memory as an unconventional object. Most COM controls can only be used as visual controls in the control container, and most of the unconventional objects, such as those accessible through the Microsoft ADO interface, can only be used in memory without placing in the form or web On the page. The purpose of the OWC library design is to use in any way. This allows you to use these controls or use these controls, such as the recalculation of the electronic tables, such as the recalculation of the electronic tables, such as the recalculation of the electronic tables, such as the recalculation of the spreadsheets, such as the various background services of these controls. This ability to be used in a non-visible object, also allows you to easily generate static contents that can be viewed in any web browser on any web browser on any web browser (more about this chapter. In this regard). All controls support a group of rich programming interfaces that can be able to call Dual COM interfaces or dispatches in Microsoft JScript, Microsoft VBA (Visual Basic for Application), Microsoft JScript, Microsoft VBA (Visual Basic for Application), Java, C , and any other. Call in the language of the COM interface. This means that you can add these components to a custom solution and design their appearance and behavior based on your needs. I will discuss most of these components in subsequent chapters, and these solutions can be included in this book by telling various solutions in these sections. Find in the CD.

See

If you are looking for an authority for COM technology, I suggest you read the book of David Chappell's "Microsoft Press, 1996)".

Let's browse every component and discuss which type solution we can use to build. It has been mentioned before, and the four chapters will be more in-depth discussion.

Spreadsheet component

The spreadsheet assembly (shown in Figure 1-1) is like a Lite of an Excel spreadsheet, consists of an spreadsheet user interface and a bail engine, supports almost all computing functions in Excel 2000. Using this control, you can change and recall the value; sort, filter, and scroll data; the protection unit is not modified; even reloading the data into Excel 2000 for further processing. The spreadsheet control can be loaded from the incoming parameters or any URL from the Excel spreadsheet file to the HTML format.

Figure 1-1 Electronics Table Components

When you want to create a valid spreadsheet model on your internet internet so that others can modify the input values ​​and see the results of the recalculated results, and the spreadsheet control is useful. For example, mortgage calculator and repayment schedule model, product balance balance model, and sales prediction form.

This control is also useful for any type of crosstab or a table-based data entry, especially when you need a formula with automatic rejuvenation. For example, cost reports, event tables, and budget reports.

The spreadsheet control can bind units to the properties of other objects on the page, and then automatically update the unit and other units associated with the unit when the data source indicates when the attribute value changes. This allows real-time data for some specific environments in the spreadsheet, such as stock portfolios.

In order to achieve even when you edit other formulas in the electronic form being working or in other unit settings format, the spreadsheet can continue to monitor new data and recalculate, and the spreadsheet control makes a special design.

Chart component

The chart component (shown in Figure 1-2) can be said to be a streamlined of the Excel chart that supports most two-dimensional chart types in Excel2000, such as Polar chart types. Another important feature of chart components is capable of displaying multiple graphs immediately, allowing you to create a small multiple design - in other words, a series of graphics based on a certain attribute change can be made immediately. A chart can be binded to the spreadsheet control, a data perspective control or an ADO's RecordSet object, or use the original data to populate. When binding to a data source, whenever the data source changes chart controls will be updated. See

If you need more information about small multiple designs, see Edward Tufte's book "Envisioning Information (Graphics Press, 1990)".

Figure 1-2 Chart Components

When you need to use a chart to represent dynamic data or monitor your business, it is very important to make a very important element. The chart control will be quite useful. Because it provides a rich programming model, you can also use this control to add a number of effects to the chart, such as scaling and translating on the maximum range of the coordinate axis, dynamically change the contents of the chart in the application according to the position of the mouse, or Let the user double-click a link to go to a new page that displays more information about the selected data point.

Data perspective component

Data perspective components (shown in Figure 1-3) are designed to provide interactive data reports and analysis functions, which can provide all functions of the Excel data perspective and a variety of external data types. It can extract data from the table, and related databases from the table, and relational databases, can also extract data from the Cube and Cube files of the OLAP server through OLE DB. With this control, you can make a variety of ways, slice, and sort and view, create a beautiful report and interactive analysis capabilities on dynamic data.

Although it is most suitable for data reports and data analysis solutions, you can use this control in many tasks. When you are bound to an OLAP Cube, the data perspective control provides users with a flexible and efficient analysis interface. IT institutions are able to concentrate on collecting and organizing data based on their company's understanding, and putting data into CUBE, and users who operate this control can slice data according to their own demand.

Figure 1-3 PivotTable

The data perspective report can also complete the same work directly on the relational database, so you can use this control even if you have no investment on the OLAP system. However, the performance of the OLAP data source is always more fast, because the essence of this technology. OLA has other logical benefits, we will discuss it in the seventh chapter to discuss it in depth when selling analysis and reporting solutions.

Data source component

Data Source Components (DSC) are the backbone frame of controls that require data from the external data source. Although this control is invisible, it is widely used to obtain and process data from the term (ILAP) or temporary OLAP CUBE (detail in Chapter 4), and in various controls The establishment of data is established. Since the data source components are the same as those in Internet Explorer and the Visual Basic, they support the same standard interface, which in these environments are interoperable. Data source components get a lot of use in the data access page features of Access2000, and integrate the functions in many Access report engines.

When other components are to get data from the external database, they are almost used to use the data source components. However, it also supports its own programming model, you can use it to create or operate the RECORDSET object. In general, you don't need too much consideration of data source controls because other components and access2000 data access page designers will set and call it.

Doubt: 1, The "Components" Part of Owc's Name Is A Touch confusing This sentence translation? 2, The Pivottable Component (Shown in Figure 1-3) Province ALL The Functionality Found in Excel Pivottables and External Data Ranges How to translate?

Appendix: English

What Are The Office Web Components?

The Office Web Components are a set of Component Object Model (COM) controls designed to bring interactive spreadsheet modeling, database reporting, and data visualization to a number of control containers The OWC library contains four principal components:. Spreadsheet, Chart, PivotTable, and .

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 used to saying COM after we stopped using the Term "OLE." Since I'm Not a Marketing Person, I'll Just Use The Term Com in this book to describe The Component Object Model Technologies. (throw ... for a loop: Eat surprising)

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. These controls definitely do not have all the features found in Excel and Access-in other words, you would not want to dynamically download all of Excel and Access to view a report in your browser! However, the controls do contain many of the commonly used features, especially those 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 user 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 are not supported by each component. I'll also show you how to add some of these missing features with your own cod e.

The "Web" part of OWC's name is often misleading. The controls are standard COM controls and can be used in many control containers such as Microsoft Internet Explorer, Microsoft Visual Basic, Microsoft Visual C , Microsoft Visual FoxPro, or Microsoft Office UserForms. However , the controls have a few behaviors that make them especially suited to the unique environment of Internet Explorer. for example, web browsers automatically support scrolling along a document, and it's often annoying for a control in the page to have its own set of scroll bars . The Spreadsheet and PivotTable controls can be set to automatically adjust themselves 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 numeric RGB values. That means you can set The Background Color of An Element To "Cornsilk" or "PAPAYAWHIP", And The Control Will Convert The Color to the approP Riate 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 used 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 used only as visible controls in control containers, and most invisible objects, such as those accessed via the Microsoft ActiveX Data Objects (ADO) interface, can be used only in memory and can not be put on a form or web page. The OWC library was built so that its components could be used either way, which enables you to use the controls with the user interfaces they expose or for their base services, such as spreadsheet recalculation. The ability to use the components as invisible objects also enables you to use the library on a server to easily generate static content that users can vie w in any web browser (more on that later in the chapter) .All the controls support a rich set of programming interfaces that you can call from Microsoft VBScript (Visual Basic Scripting Edition), Microsoft JScript, Microsoft VBA (Visual Basic for Applications) , 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, .................... ..

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 Chapter. 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 user 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, filter, 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 useful 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 useful for any kind of cross-tabulated or grid-based data entry, especially when you need to use formulas with automatic recalculation. Examples include expense 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 recordset Object, or it can be filled with literal data value. 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, See Edward Tufte's Book Envisioning Information (Graphics Press, 1990).

Figure 1-2. The Chart Component.

The Chart control is primarily useful any time you need to chart live data or monitor a specific metric critical to your business. Because 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 based on the mouse's location, or letting users double-click to link to a new page displaying more information about the selected 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 databases through OLE DB, as well as from OLAGH OLE DB for OLAP. Using this Control, You Can View Data Grouped, Slic, And Sorted In A Variety of Ways, Creating Polished Reports and Interactive Analysis on Live Data.

You can use this control for many tasks, although it's best suited for database reporting and data analysis solutions. When bound to an OLAP cube, the PivotTable control can provide the user with a flexible, high-performing analysis surface. IT groups can concentrate on Collecting and cleanning data and loading it.

Figure 1-3. The Pivottable Component.

The PivotTable control can also perform the same operations directly on a relational database, so you can use it even if you do not have an investment in an OLAP system. However, the performance when using an OLAP data source is always much faster because 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 used 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 those environments. The DSC is used heavily in Access 2000's data access pages feature and .

The DSC is involved almost any time the other components retrieve data from an external database. However, it also supports a programming model of its own, and you can use it to build or manipulate hierarchical Recordset objects. In general, you do not need THINK MUCH ABOUT The DSC Since The Other Components and The Access 2000 Data Access Page Designer Will Set IT Up and Implement It for you.

转载请注明原文地址:https://www.9cbs.com/read-27071.html

New Post(0)