PROGRAMMING MS Office 2000 Web Components Chapter III

zhaozj2021-02-16  54

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.

Where can I use these components?

Since Office Web Components are COM controls, you will naturally hope they work in any environment that claims to be a COM control container. However, theory and reality are not always consistent, especially in the software world. Microsoft has created many environments that include controls (our team can say 16), and other companies have created many other environments.

In order to avoid the Office's test team, we do different levels of Office Web Components for different containers. First, we pick out the most containers we think that people use, and fully test it. Then we have basic and special tests in the container that is not used. Finally, we organized some containers to form a "no formal test, but did not produce catastrophic consequences". Table 1-1 shows the container in this range.

Table 1-1. Testable container.

Container

Test coverage

Microsoft Internet Explorer 5.0

Full

Microsoft Internet Explorer 4.01

Full

Microsoft Internet Explorer 3.x

NOT Supported

Microsoft Visual Basic 6.0

Full

Microsoft Visual Basic 5.0

Basic

Microsoft Visual InterDev

Basic

Microsoft Access Forms

Basic

Microsoft Office UserForms

Basic

Microsoft FrontPage 99

Full

Microsoft FrontPage 98

Basic

Microsoft Access 2000 Data Access Page Designer

Full

Microsoft Script Editor

Full

Microsoft Word 2000

Basic

Microsoft Excel 2000

Basic

Microsoft PowerPoint 2000

Basic

Microsoft Outlook 2000

Basic

Microsoft Visual C / MFC Projects

None

Microsoft Visual J

None

Also, pay attention to the design of the control in different containers is very different. Because Office Web Components are quite complex controls, you often need to select elements within the control (such as units in the spreadsheet, perspective fields in the data perspective report, or a series of data points in the chart), and format or process these elements. . In order to be able to implement this feature, the control will interface in the container that allows the control interface to activate, which means that these controls will respond to the mouse and keyboard events. Any modifications made to the control in the design mode will be reserved with the document or form when you overload the control during operation, which makes the control when you are reset. Some containers will activate the control interface immediately when you click on the control. And other containers require double-click control. There are other containers that require you to activate these controls twice. These behaviors are completely determined by the container. Therefore, please refer to the container's documentation to understand how the container processes the COM control during the design phase.

Note that these do not affect behavior during the operation of the control. During operation, all containers will activate the control interface after loading the control. But some environments, such as Office documents, because you always edit the currently loaded document, so you will never enter the operating state. Internet Exlorer, Visual Basic, Visual C , Access Forms, and Office user interfaces have runtime mode, and the control will be activated immediately. Data Access page and Internet Explorer 5

If you read any Access2000 documents, you are likely to see some statements tell you to browse the data access page in Internet Explorer5 or later. Although this is true, this statement is generally not applicable to Office Web Components. These components can be used in Internet Explorer 4.01 and above, however they cannot be used in any earlier versions (4.0, 3.x, 2.x, etc.). This version requires any interaction content created using Excel2000 (creation procedure using Office Web Components), and also applies to customization solutions developed using these components. Data Access Pages require some special features in Internet Explorer5, which is why they can only run in this environment. However, Office Web Components itself can be used well in the test-tested containers listed above.

Use Office Web Components on the server

The foregoing mentioned that Office Web Components can reside in the form, document, or web page in the form of controls, or may reside in memory in the form of an object without user interface. Each control provides an attribute or method to return the statically express form of the current content of the control. The charts and data perspective controls can create GIF graphics for their content, while the spreadsheet control can return an HTML table segment or a complete page page, which can be displayed in any browser compatible with the HTML3.2. All of this means that you can use these controls on the web server, implement the server-side chart graphics and data perspective reports, or implement the server-side spreadsheet model rejection. I will demonstrate some such techniques in the second part of this book.

In addition to discussing how to use these controls on the server, we will also examine many more fine problems, such as performance, scalability, and reliability in the back of this book.

Deployment

One of the most attractive aspects of web-based solutions is that there is no need to display installation. What you need to do is programmed in the page in the form of a script or is automatically downloaded in the form of Applets or COM controls. Office Web Components enables a deployment and automatic update mechanism without installing by using the CodeBase feature of Internet Explorer. These components also include a mature web installation tool that makes the download process is very interesting. Also, OWC does not rely on Office 2000 technology, so it can coexist with the Office97 environment and can be used on a machine where any Office software is installed.

In Chapter 12, all aspects regarding deployment tasks are involved, and how to establish an OWC solution.

How about Netscape Navigator?

When I tell the Office Web Components in the discussion and other user gatherings, someone will ask this question: "Can these components run in Netscape Navigator?" The answer is clear "No," But there are some need to explain here. The place.

Netscape Navigator 4.5 itself does not support COM controls, so if no plugin is installed, Office Web Components can't even be loaded by Netscape Navigaotor. However, a company named NCompass Labs develops a control for Netscape Navigator, making Netscape Navigator to control the COM control in the web page. So, can you use these components in Netscape Navigator? The answer is "see the situation", there are some need to explain here. You may use OWC to build a solution that contains inter-component communication -, for example, binding to a chart on a data perspective or spreadsheet, or a spreadsheet unit that is bound to other element properties on the page. These solutions require support for the features provided by Internet Explorer. Even Netscape Navigator installed in the NCompAMPASS plug-in cannot provide these features, so these solutions cannot work in Netscape Navigator at all.

Use a single component or a solution to multiple components that do not communicate with each other, it is possible to successfully run in Netscape Navigator. However, this is one of the containers that have not been studied in our test team, so I can't guarantee that it will succeed.

You should still remember, in any case, static content generated by the controls on the server can be displayed in Netscape Navigator and Internet Explorer. So if your running environment needs to support two browsers, you may be interested in using these components on Web Server and showing solutions for implementing these features.

Appendix: English

WHERE CAN you use the company?

Since the Office Web Components are COM controls, you'd naturally expect them to work in any environment that called itself a COM control container. However, theory and reality do not always match up, especially in the world of software. Microsoft makes many Environments That Can Contain Controls (16 That Our Team Could Recall Off The Top of Our Heads, And Various Other Companies Create Many Others.

To keep the Office test team from going mad, we tested the Office Web Components at different levels in different containers. First, we picked the containers we thought people would use most and performed full test passes on them. We then performed basic, ad hoc testing on the containers used less often. And finally, we grouped a few containers into the "not formally tested but does not cause a nuclear meltdown when tried" category. Table 1-1 shows which containers fell into what category.Table 1- TESTED Containers.

Container

Test coverage

Microsoft Internet Explorer 5.0

Full

Microsoft Internet Explorer 4.01

Full

Microsoft Internet Explorer 3.x

NOT Supported

Microsoft Visual Basic 6.0

Full

Microsoft Visual Basic 5.0

Basic

Microsoft Visual InterDev

Basic

Microsoft Access Forms

Basic

Microsoft Office UserForms

Basic

Microsoft FrontPage 99

Full

Microsoft FrontPage 98

Basic

Microsoft Access 2000 Data Access Page Designer

Full

Microsoft Script Editor

Full

Microsoft Word 2000

Basic

Microsoft Excel 2000

Basic

Microsoft PowerPoint 2000

Basic

Microsoft Outlook 2000

Basic

Microsoft Visual C / MFC Projects

None

Microsoft Visual J

None

Also note that the design-time activation of the controls varies quite a bit from container to container. Since the Office Web Components are fairly complex controls, it is often necessary to select elements within a control (such as a cell in a spreadsheet, a pivot field in a PivotTable report, or a series of data points in a chart) and format or perform operations on them. to enable this functionality, the controls will become UI active in containers that allow this, meaning they will respond to mouse and keyboard events. Any changes made to the controls in design mode will persist with the document or form when it is reloaded at runtime, resetting the controls to look exactly as they did when you saved them. Some containers make the controls UI active as soon as you click them. Others require that you double-click the control before it becomes UI active. Still other containers require you to single-click them twice to activate them. This behavior is entirely determined by the contai ner, so refer to the container's documentation to see how it deals with COM controls at design time.Note that this does not affect a control's runtime behavior. At runtime, all containers make the controls UI active after loading them. But some environments, such as Office documents, never get into a runtime state because you are always editing the document that's currently loaded. Internet Explorer, Visual Basic, Visual C , Access Forms, and Office UserForms all have a runtime mode in which the controls are immediately active.

Data Access Pages and Internet Explorer 5

If you read any of the Access 2000 documentation, you will likely see statements that say you can view data access pages only in Internet Explorer version 5 and above. Although true, that statement does not apply to the Office Web Components in general. The components will function in Internet Explorer 4.01 and above, though they will not function in any earlier versions (4.0, 3.x, 2.x, and so on). This applies to any interactive content created with Excel 2000 (which uses the Office Web Components) and to custom solutions developed using the components.Data access pages rely on a few specific features in Internet Explorer 5, which is why they only run in that environment. However, the Office Web Components themselves can run quite happily in the tested Containers Listed Earlier.

Using the Office Web Components on a Server

As mentioned before, the Office Web Components were designed to run both as controls "sited" within a form, document, or web page, and as objects in memory with no user interface. Each of the controls exposes a property or method that returns a static representation of its current content. The Chart and PivotTable controls can create GIF images of their content, and the Spreadsheet control can return an HTML table fragment or full page that can be rendered by any browser that's compatible with HTML 3.2. All of this means you can use the components on a web server to perform server-side generation of chart images and PivotTable reports or server-side recalculation of a spreadsheet model. I'll demonstrate a few of these techniques in Part II of the book.

Besides Discussing The How-to Of Using The Components On The Server, We'll Examine a Number of More Subtle Issues Related To Performance, Scalability, And Reliability Later in The Book.Deployment

One of the more attractive aspects of web-based solutions is that they do not require explicit setup of an application. Anything needed is either included with the web page in the form of scripts or is automatically downloaded as applets or COM controls. The Office Web Components enable a no-install deployment and automatic upgrade mechanism by using the codebase feature of Internet Explorer. The components also include a sophisticated web installing control that makes the download experience much more attractive. Furthermore, OWC has no technological dependency on Office 2000, SO IT CAN COEXIST IN OFFICE 97 Environment Or Be Used on a Machine That Doesn't Have Any Other Part Ofice Installed.

I'll Cover All The Aspects of Deployment and how you can build your solution to automatically deploy inc in chapter 12.

What about netscape navigator?

When I talk about the Office Web Components at conferences or other customer gatherings, invariably someone asks the question, "Do these run in Netscape Navigator?" The answer is essentially "no," but it has a few caveats.

Netscape Navigator 4.5 does not natively support COM controls, so without any plug-ins, the Office Web Components will not even be loaded by Netscape Navigator. However, a company called NCompass Labs, Inc. makes a plug-in for Netscape Navigator that can host COM controls in a web page. So if you installed this plug-in, could you use the components in Netscape Navigator? The answer is "it depends" and, again, has a few caveats.Many solutions you might build with OWC involve communication between the components-for instance, a chart bound to a PivotTable or spreadsheet, or a spreadsheet cell bound to the property of another element on the page. These solutions depend on functionality provided in Internet Explorer that is not present in Netscape Navigator Even with the ncompass plug-in, SO They Simply Won't work in Netscape Navigator.

Using a single component or multiple components that do not communicate with one another is possible in Netscape Navigator. However, this is one of the containers that our test team did not research, so I can not guarantee that it will work.

You should always remember, however, that static content generated by the controls on the server can be rendered in either Netscape Navigator or Internet Explorer. So if your runtime environment requires that you support both browsers, you probably will be more interested in using the components Your Web Server and in The Solutions That Show The Techniques That Do SO.

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

New Post(0)