This documentation is archived and is not being maintained.

Using the Microsoft Data Analyzer ActiveX Control in Web Pages

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
 

Paul Cornell
Microsoft Corporation

December 2001

Applies to:
   Microsoft® Data Analyzer

Summary: This article describes how to embed the Microsoft Data Analyzer ActiveX Control in Web pages hosted by Microsoft FrontPage, a Web site based on SharePoint Team Services by Microsoft, a SQL Server Digital Dashboard 3.0 dashboard, or Microsoft SharePoint Portal Server.

Contents

Introduction
Development Approaches
Examining the Code
Adding the Control to a Microsoft FrontPage 2002 Web Page or a Web Site Based on SharePoint Team Services
Creating an Instance of the Control in a SQL Server Digital Dashboard 3.0 Dashboard
Creating an Instance of the Control for Use in a Microsoft SharePoint Portal Server 2001 Web Site
Conclusion

Introduction

The Microsoft Data Analyzer is a member of the Microsoft Office family of software applications. Data Analyzer enables you to graphically mine your organization's multidimensional data. Solution developers can expose the core features of Data Analyzer as an ActiveX® control in a Visual Basic® for Applications (VBA) UserForm, as well as on a Web page. This article describes how to use the Data Analyzer ActiveX control in Web pages.

For more information about using the Data Analyzer ActiveX control in VBA UserForms, as well as an overview of the Data Analyzer ActiveX control's overall object model, see my earlier article Exploring Microsoft Data Analyzer Programmability.

For general information about Data Analyzer, see the Microsoft Data Analyzer Web site.

Development Approaches

There are two main approaches to using the Data Analyzer ActiveX control in Web pages. You can:

  • Add a new instance of the control to a Web page, or edit an existing instance of the control in a Web page, using Microsoft FrontPage®.
  • Create a Web Part containing an instance of the control in a dashboard created with SQL Server™ Digital Dashboard 3.0 or Microsoft SharePoint™ Portal Server 2001.
Note   To view and interact with the Data Analyzer ActiveX control, a user must have a licensed copy of Data Analyzer installed on their computer. The Data Analyzer ActiveX control cannot be distributed separately from the full Data Analyzer product.

Before we examine both approaches, let's look at the code that is used to create and automate an instance of the Data Analyzer ActiveX control.

Examining the Code

Regardless of the development approach you take, here is the basic HTML code to create an instance of the Data Analyzer ActiveX control:

<object classid="clsid:E0ECA9C3-D669-4EF4-8231-00724ED9288F"
id="Max3Ax1" height=100% width=100%></object>

You can also modify the control's startup behavior at design time by entering one or more <param> tags between the <object> and </object> tags as follows:

<param name="Member" value="Value">

Where "Member" is one of the following members, and "Value" is the corresponding member's value:

  • Application   Retrieves the Application object from the control. Although you can add a <param name="Application"> tag to the <object> tag, the Application method has no meaningful purpose at design time.
  • ExitCommandVisible   Determines whether the Exit command on the control's File menu is visible (value="-1"). The default value is to hide the Exit command (value="0"). Example:
    <param name="ExitCommandVisible" value="0">
    
    
  • InteractiveStartup   Determines whether the Microsoft Data Analyzer Startup dialog box is displayed when the page containing the control is opened (value="-1"). The default value is to hide the Microsoft Data Analyzer Startup dialog box (value="0"). Example:
    <param name="InteractiveStartup" value="0">
    
    
  • SupportIEHistory   If the control is viewed on a Web page hosted in Microsoft Internet Explorer 4.0 or later, this method determines whether the control retains its state when the user navigates away from the Web page containing the control and back again, which is the default (value="-1"). To disregard the control's state during page navigation, set value="0". Example:
    <param name="SupportIEHistory" value="-1">
    
    
  • ViewData   When the value of this method is set to a valid XML string, this method sets the control's view to the contents of the XML. If a value is specified for this method, it overrides any value provided for the ViewURL method. Although you can add a <param name="ViewURL"> tag to the <object> tag, the ViewData method has no meaningful purpose at design time (unless you were to handcraft a valid XML string containing the entire view's visual representation!).
  • ViewURL   Loads the view specified in the value parameter when the control is first displayed on the Web page. If a value is also provided for the ViewData method, the value of the ViewURL method is ignored. Example:
    <param name="ViewURL" value="C:\Program Files\Microsoft Data Analyzer\
          Data Analyzer 3.5\Airline.max">
    
    
    Note   Contrary to its name, the ViewURL method cannot open views using HTTP URLs. It can only open views using file system paths or a valid XML string that conforms to the Data Analyzer view schema.

Once you add the Data Analyzer ActiveX control to a Web page, you can write script against it using the id value provided in the <object> tag (in this case, Max3Ax1). For example, the following HTML code opens a view:

<script id=clientEventHandlersVBS language=vbscript>
<!--
Sub window_onload
    'The number 1 represents the constant vlocFileSystem 
    '(corresponds to a file in the file system).
    Max3Ax1.Application.ActiveView.OpenView _
        "C:\Program Files\Microsoft Data Analyzer\" & _
        "Data Analyzer 3.5\Airline.max", 1    
End Sub
-->
</script>

Note   Similar to the ViewURL method, the OpenView method cannot open views using HTTP URLs. It can only open views using file system paths or a valid XML string that conforms to the Data Analyzer view schema.

The following code hides the main toolbar, the main menu, and the status bar from the current view:

<script id=clientEventHandlersVBS language=vbscript>
<!--
Sub window_onload
    With Max3Ax1.Application
        .ActiveView.OpenView _
            "C:\Program Files\Microsoft Data Analyzer\" & _
            "Data Analyzer 3.5\Airline.max", 1
        'Hide the main toolbar, main menu, and status bar. 
        .MainToolbar.Bands.Item("MainToolBar").Visible = False
        .MainToolbar.Bands.Item("MainMenu").Visible = False
        .MainToolbar.Bands.Item("Main.StatusBar").Visible = False
    End with
End Sub
-->
</script>

Adding the Control to a Microsoft FrontPage 2002 Web Page or a Web Site Based on SharePoint Team Services

To add the Data Analyzer ActiveX control to a Microsoft FrontPage 2002 Web page or a Web site based on SharePoint™ Team Services from Microsoft, you must have Data Analyzer installed on the same computer from which you perform the following steps:

  1. Start FrontPage 2002.
  2. Do one of the following:
    • On the File menu, point to New, and click Page or Web. In the New Page or Web task pane, click Blank Page.
    • On the File menu, click Open, and select an existing Web page.
    • On the File menu, click Open Web, and select an existing FrontPage Web or a Web based on SharePoint Team Services. Once the Web is open, on the View menu, click Folders, and select an existing Web page.
  3. Position your insertion point at the place on the Web page that you want to insert the Data Analyzer ActiveX control.
  4. On the Insert menu, click Web Component.
  5. In the Component Type pane, click Advanced Controls.
  6. In the Choose a control pane, click ActiveX Control, and click Next.
  7. Click Customize.
  8. In the Control list, check the Max3Ax Class box, and click OK.
  9. In the Choose a control list, click Max3Ax Class, and click Finish.
  10. Switch to HTML view to modify the code that FrontPage generates.
  11. Switch to Preview view to view and interact with the results. Notice that you can use the Data Analyzer user interface just as you would if you had started Data Analyzer from your Programs menu (you may need to switch back to Normal view to resize the Data Analyzer user interface).

Creating an Instance of the Control in a SQL Server Digital Dashboard 3.0 Dashboard

To manually add the Data Analyzer ActiveX control to a dashboard based on SQL Server Digital Dashboard 3.0. This procedure assumes that you have both Data Analyzer and the Digital Dashboard Resource Kit installed on an appropriate Web server (for more information on Digital Dashboard installation, see the Microsoft Digital Dashboard Web site).

  1. Navigate to your DDRK Web site. The URL for this site will generally take the form http://WebServerName/Dashboard.
  2. Click the Administration link in the top link bar.
  3. In the Dashboard View pane, expand DAVCatalog, click Parts, and click New.
  4. In the Dashboard Properties pane, in the Name box, type DataAnalyzer, and in the Display Name box, type Data Analyzer.
  5. In the Web Part List pane, click New.
  6. In the Web Part Properties pane, on the General tab, in the Name box, type DataAnalyzer, and in the Display Name box, type Data Analyzer.
  7. On the Advanced tab, in the Content Type box, click HTML.
  8. In the Embedded Content box, type the code to represent the Data Analyzer ActiveX control, and then click Save. For example:
    <object classid="clsid:E0ECA9C3-D669-4EF4-8231-00724ED9288F"
    id="Max3Ax1" height=325 width=745>
    <param name="InteractiveStartup" value="0">
    <param name="ViewURL" value="C:\Program Files\Microsoft Data
    Analyzer\Data Analyzer 3.5\airline.max">
    <param name="SupportIEHistory" value="-1">
    <param name="ExitCommandVisible" value="0">
    </object>
    
    
  9. In the Dashboard View pane, click Go to see the dashboard.
  10. To export this Web Part for use in other dashboards, in the Web Part List pane, click the Data Analyzer Web Part. In the Web Part Properties pane, click Export. Browse to a location where you want to store the Web Part, and click Save.

Creating an Instance of the Control for Use in a Microsoft SharePoint Portal Server 2001 Web Site

These steps assume that you have Data Analyzer and Microsoft SharePoint Portal Server 2001 installed on an appropriate Web server and have rights to publish on that server.

  1. Navigate to your SharePoint Portal Server workspace. The URL for this site will generally take the form http://WebServerName/WorkspaceName.
  2. Click the Management tab in the top-most link bar.
  3. Click Create a new personal dashboard.
  4. Leave all of the default settings, and click Save.
  5. Click Content in the upper right corner of your new personal dashboard.
  6. Click Create a New Web Part.
  7. In the Name box, type Data Analyzer.
  8. Type the code to represent the Data Analyzer ActiveX control in the Embedded content box, and then click Save. For example:
    <object classid="clsid:E0ECA9C3-D669-4EF4-8231-00724ED9288F" 
    id="Max3Ax1" width=325 height=745>
    <param name="InteractiveStartup" value="0">
    <param name="ViewURL" value="C:\Program Files\Microsoft Data
    Analyzer\Data Analyzer 3.5\airline.max">
    <param name="SupportIEHistory" value="-1">
    <param name="ExitCommandVisible" value="0">
    </object>
    
    
  9. Click Save again to view your dashboard.
  10. To export this Web Part for use in other dashboards, click Content in the upper right corner of your new personal dashboard. In the Web Parts area, click the entry that corresponds to the Web Part you want to export, and then click Export. Browse to a location where you want to save the Web Part, and click Save.

Conclusion

In this article, you were shown how to add an instance of the Data Analyzer ActiveX control to a Microsoft FrontPage 2002 Web page, a Web site based on SharePoint Team Services, a SQL Server Digital Dashboard 3.0 dashboard, and a SharePoint Portal Server 2001 workspace. You were also shown how to script against the control to extend the control's features. Using the sample code and procedures in this article, you can now add robust data analysis features to your Web sites using the Data Analyzer ActiveX control.

Show: