Open a Model and Drill Through to a PowerCube Example
This example opens a model and uses the Quantity
measure to set a drill through to a PowerCube.
Sub Example14()
Dim objTransApp As Object
Dim objModel As Object
Dim objMeasure As Object
Dim objReport As Object
Dim strIBMCognos10Location As String
Dim strModelPath As String
Dim strModelSource As String
Dim strReportPath As String
Dim strReportSource As String
'Change these paths to match your installation
strIBMCognos10Location = "C:\Program Files\IBM\Cognos\c10\"
strModelSource = "great outdoors sales.mdl"
strReportSource = "drill_through_to_cube_7.mdc"
strModelPath = strIBMCognos10Location & _
"webcontent\samples\models\Transformer8\EN\" & strModelSource
strReportPath = strIBMCognos10Location & _
"webcontent\samples\datasources\cubes\PowerCubes\EN\" &
strReportSource
objTransApp = CreateObject("IBMCognosTransformer.ApplicationCtrl.1")
With objTransApp
.DataSourcePath = strIBMCognos10Location & "bin"
.TransdaPath = strIBMCognos10Location & "CS7Gateways\bin\TransDa.exe"
End With
objModel = objTransApp.OpenModel(strModelPath)
objMeasure = objModel.Measures.Item("Quantity")
With objMeasure
.AllowDrillThrough = True
.Update()
End With
objReport = objMeasure.DrillThroughTargets.Add(strReportPath,
"Default Report")
objModel.SaveAs("great outdoors salesX.mdl")
objModel.Close()
objReport = Nothing
objMeasure = Nothing
objModel = Nothing