If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Using a Macro to Change Catalog Location

Started by Wildrose, 08 Jun 2007 09:15:21 AM

Previous topic - Next topic

Wildrose

I am using the below code to upgrade reports to Impromptu. However what also needs to happen is change the location of the catalog the report is pointing to, to the location of the catalog in the folder. Within a folder will be the reports and catalog. The reports are getting to the folder by coping them from one location to a new location. In the properties the catalog is off on another drive and I want the report to point to the catalog in the same folder as the reports. I have check with Cognos and they gave me a snippet of the code and I don't understand it. I want to encorporate something in my below code. Any pro scripters out there that can enhance my code to perform the task?



Dim ImpAppObject as Object
Dim ImpRepObject as Object
Dim strPath as String
Dim strExtension as String
Dim strFolder as String
Dim PromptVal As String



'----"Save As" Locations
Dim strPath1 as String

Sub Main()
strPath = "C:\Reports_To_Upgrade\"
strFolder = dir("c:\Reports_To_Upgrade\*.IMR")
strPath1 = "C:\Reports_To_Migrate\"
Set ImpAppObject = CreateObject("CognosImpromptu.Application")
ImpAppObject.Visible 0

'----Open the catalog
ImpAppObject.OpenCatalog "c:\Reports_To_Upgrade\MetricsLibrary.Cat","Creator", "password","userid","useridpassword"

'----Open each report file in the directory upgrade and save it to the output folder (strPath1)

Do While StrFolder <>""


Set ImpRepObject = ImpAppObject.OpenReportNoExecute(strpath & strfolder)

'---Save the upgraded report to the output folder, close the original report, then go to the next one
ImpRepObject.SaveAs strpath1+strfolder
ImpRepObject.CloseReport
strFolder = Dir

loop

ImpAppObject.Quit
Set ImpAppObject = Nothing
End Sub

Medy4

I'm trying to write a report updater and thought that OpenReportNoExecute would avoid all my report prompts.

It did but it also removes the "retrieve data automatically" flag from the Report Query access panel.

Use this method with caution.

ksvnsujatha

Require the current version of cognos & what needs to be done so that they work correctly with Oracle 10G