Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i open a Powerplay report using cogmos script in series 7.1 1

Status
Not open for further replies.

aminaalavi

Programmer
May 22, 2003
15
0
0
FR
I am creating a dialog box and want a powerplay report to open up when the user clicks the button. Could someone please tell me what code i use to open the powerplay report. I have my code below, but it is not working.

Thanks

Amina

Dim objPPRep as Object
Set objPPRep = CreateObject("CognosPowerPlay.Report")
objPPRep.Open "c:\forecating.ppr"
objPPRep.Visible
objPPRep.Close
Set objPPRep = Nothing

 
Hi Amina,

You may want to try this instead as you were missing the value for the visible property.

Sub Main ()

Dim objPPRep as Object

Set objPPRep = CreateObject("CognosPowerPlay.Report")

objPPRep.Open "d:\test.ppr"
objPPRep.Visible = True

End Sub

Scott
 
Thanks Scott. I changed the code to include your suggestion. It compiles fine. When i run it , i get the following error:

TEMP6!main(4) - R440 "PowerPlay: An internal error occurred."

I am not really sure what it means

Thanks again
Amina
 
Hi Flex13. After you have opned the powerplay report, how can you then export the result as text or as a spread sheet ? :->
 
This script opens a remote cube, creates a report and then saves it out as the default ppr, xls and asc formats.

Sub Main()

Dim objPPApp As Object
Dim objPPRep As Object

Set objPPApp = CreateObject ("CognosPowerPlay.Application")
Set objPPRep = CreateObject ("CognosPowerPlay.Report")
objPPRep.New "PPDSRemote;wottmassons-2k:8010;Sample Cube"
objPPRep.Visible = true

objPPRep.SaveAs "D:\MyNewReport.ppr"
objPPRep.SaveAs "D:\MyNewReport.xls",4
objPPRep.SaveAs "D:\MyNewReport.asc",3
objPPRep.Close

Set objPPRep = Nothing
Set objPPApp = Nothing

End Sub

Hope this helps.

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top