Share via


Step 4: Building the Cube for Task Issues and Risks

In Steps 2 and 3, you used the OLAP Breakout Test application to run the breakout functions. Breakout function 1, UserStagingTablesUpdate, updated the Microsoft® Office Project Server 2003 staging tables with risks and issues data from Microsoft Windows® SharePoint™ Services. Breakout function 2, UserOLAPCubeUpdate, then copied data from the staging tables to SQL Server Analysis Services and used Decision Support Objects (DSO) to programmatically build the risks and issues cubes.

In Step 4, you will set the system to automatically update the risks and issues cubes whenever Portfolio Analyzer updates the cube. You will also add the risks and issues view to the Portfolio Analyzer views.

To automatically update the risks and issues cubes:

  1. In the TaskIssuesRisks directory of the installed Portfolio Analysis OLAP Extensions Solution Starter, double-click the file OLAPDemoGroup.vbg to open the project group in Visual Basic.

  2. Click the MSPOLAPBREAKOUT project in the Visual Basic Project Explorer pane and, on the File menu, click Make MSPOLAPBREAKOUT.dll.

  3. Optional. Click the OLAPBreakoutTest project in the Project Explorer and, on the File menu, click Make OLAPBreakoutTest.exe. It is not necessary to rebuild the test application for the breakout functions; however, you can still use it to update the risks and issues cubes at any time.

  4. Copy the MSPOLAPBREAKOUT.dll and OLAPBreakoutTest.exe files to a convenient directory on the computer where Project Server Portfolio Analyzer is installed. For example, create the subdirectory OLAPExtensions in [Program Files]\Microsoft Office Project Server 2003\BIN\ and copy the files there.

  5. Register MSPOLAPBREAKOUT.dll. Start a Command Prompt window, and enter the following commands (substitute your values for [Program Files], or the directory where you copied MSPOLAPBREAKOUT.dll):

     cd [Program Files]\Microsoft Office Project Server 2003\BIN\OLAPExtensions
      regsvr32 MSPOLAPBREAKOUT.dll
    

    You will see a RegSvr32 message box with the message DllRegisterServer in MSPOLAPBREAKOUT.dll succeeded. Press OK.

That's all there is to it! Portfolio Analyzer will now use the UserStagingTablesUpdate and UserOLAPCubeUpdate breakout functions whenever it updates the OLAP cube.

To update the cube now, open Microsoft Office Project Web Access, click Admin, and then click Manage Enterprise Features. In the Update resource tables and OLAP Cube page, make sure the option Yes, I want to update resource availability information and build an OLAP cube is selected in the section Build the OLAP cube. In the Update frequency section, click Update only when specified, and then click Update Now.

The cube may take an hour or more to build, depending on the number and complexity of the projects. When the build is completed, you will see the results in the Current Cube Status section of the Update resource tables and OLAP Cube page.

Using the Trace Function

To check that the breakout functions were used, and to check for any errors in building the risks and issues cubes, you can use the Trace function. However, the global g_trace_on variable is set to False by default.

When g_trace_on is set to True, and MSPOLAPBREAKOUT.dll is recompiled and re-registered, the breakout functions append messages to a trace file during execution; the file is C:\trace.txt. After the cubes are successfully built, if tracing is enabled, you can see in the trace file the following lines (among the other lines that show the projects found with risks and issues and the JoinClause strings):

16:28:40 Called UserStagingTablesUpdate
. . .
16:29:04 Exit UserStagingTablesUpdate OK.
16:32:12 Enter UserOLAPUpdate
. . .
16:32:23 Exit UserOLAPUpdate OK.

You can turn on the Trace function by changing g_trace_on to True in the UserOptionalCode class. If you want, you can also change the trace file name and path in the Trace subroutine of the UserOptionalCode class. To use tracing, you have to recompile and re-register MSPOLAPBREAKOUT.dll.

Important  Tracing should normally be enabled only in a development or test environment. In a production environment, the OLAP Administrator account may not have write permission for the server file system.

If it is necessary to enable tracing on a production system, that should be done only for the time necessary to track down a problem. You may also need to change the OLAP Administrator account to one that has system administrative rights to allow the OLAP COM+ component to write a file on the server.

Dim g_trace_on as Boolean
    . . .   
    g_trace_on = False    'Change to True to enable tracing
    . . .
Friend Sub Trace(sMessage As String)
    If g_trace_on Then    
        Dim iFileNum As Integer
        Dim crtDate As Date
        crtDate = Time
    
        iFileNum = FreeFile
        Open "c:\trace.txt" For Append As iFileNum
    
        Print #iFileNum, ""
        Print #iFileNum, Format$(crtDate, "hh:nn:ss") & " " & sMessage
        Close iFileNum
    End If                
End Sub

To temporarily change the user for the Project Server OLAP COM+ component:

You can add the OLAP Administrator to the Administrators group using the Computer Management utility (click Administrative Tools on the Start menu, click Computer Management, expand the Local Users and Groups node, and open Administrators in the Groups folder).

Or, you can select a different OLAP Administrator as follows:

  1. Click Administrative Tools on the Windows Start menu, and then click Component Services.
  2. Expand the tree in the left pane, including the COM+ Applications node under My Computer (if you are doing this on the Project Server computer).
  3. Right-click Microsoft Office Project Server OLAP Cube Component and click Properties on the option menu.
  4. Click the Identity tab in the dialog box. In the This user section, click Browse, and then select a user that has administrative rights on the Project Server computer. Click OK in the Select User dialog box.
  5. Click OK in the Microsoft Office Project Server OLAP Cube Component Properties dialog box.

Important  When you are done using Trace on a production server, set g_trace_on back to False in the UserOptionalCode class and recompile and re-register MSPOLAPBREAKOUT.dll. Change the OLAP Administrator group membership back to the original, or change the OLAP Cube COM+ component back to the original OLAP Administrator.

The MSP_RISKS and MSP_ISSUES cubes are now built, but, to use them, you need to add views to Portfolio Analyzer. See Using the Task Issues and Risks Cubes.