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!

Opening a catalog in a macro. 1

Status
Not open for further replies.

aminaalavi

Programmer
May 22, 2003
15
0
0
FR
Hi,

I gave created a number of dialog boxes. The buttons lead to various reports. In impromptu, i have set the preferences for file locations to where my files are. If i directly open the report without first opening the catalog with the "object.openreport " command, i am able to open the catalog. With this the catalog dialog box ( with username and PW ) opens up. If i click on cancel, it dissapears for a second and pops again until i keep clicking it and finally after 3-4 times i get an error message. For that reason i tried the "object.opencatalog " command to open the catalog first. It worked perfectly. HOwever, i do not know where the users will place there reports and catalogs so with the "object.opencatalog " command i cannot put in the path name but only the name of the catalog and the report. The users will set their file paths in the preferences of impromptu. This was fine with just the "object.openreport " command ( only the name and no path) but when i put in the object.opencatalog command ( with only the name and no path) it says that it could not locate the catalog; even though the preferences are set to the correct file locations.

Please let me know what i can do. Given below is a sample of my code:

Dim ImpApp2 As object
Set ImpApp2 = CreateObject("CognosImpromptu.Application")
ImpApp2.Visible 1
ImpApp2.Opencatalog "catalog.cat"
ImpApp2.OpenReport("report.imr")
ImpApp2.WindowState = 1
call tvlshowdlg
ImpApp2.activate
ImpApp2.Quit
Set ImpApp2 = Nothing


Thanks

Amina
 
Hi there

Maybe you can try the following - it seems to work for me. (I've also unchecked the 'Always display this screen' option on the catalog login screen.)

'Open the catalog
' ImpApp.OpenCatalog "C:\Program Files\Cognos\cer2\samples\Impromptu\reports\", "UserClassID", "UserClassPassword", "DB_user", "DB_user_password"
ImpApp.OpenCatalog "C:\Program Files\Cognos\cer2\samples\Impromptu\reports\GREAT OUTDOORS SALES DATA.CAT", "creator", "UserClassPassword", "DB_user", "DB_user_password"
 
Hi Doovat,

Thanks for this useful information. But the only problem is that i cannot put in the path name before the nameof the catalog as i do not know where the users will place there reports and catalogs. The macro will be distributed to various offices which might have different drives for saving the macro. I tried placing the catalog in the folder as the macro but did not work either.

Thanks a lot Doovat,

Amina
 
Amina,

As long as the users can run with a standard database id with consistent access rights, what I recommend is to embed the database id and password into your catalogs. If the typical end user is not a report author and will only run the report or enter prompts, set up a 'Run_Only' class with no password. Then when the macro opens the report, the report calls the catalog associated with it and the user should only have to press 'Enter' at the Run_Only class catalog prompt and the report will run. That way you don't have to code for all the possibilities of what catalog is associated with what report.

Hope this helps,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ20-2863 first!
 
Excellent suggestion Dave. That is exactly what i am goign to do. You saved me so much trouble. Thanks a lot

Amina
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top