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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do I get this error when using impromptu 6.0 user version??

Status
Not open for further replies.

ice76

Programmer
Sep 30, 2002
6
SG
Hi,

As my company is upgrading cognos impromptu from version 5 to 6, I am tasked to test the application. The application contains macros which run perfectly in administrator version but not in user version. I think the problem lies due to lack of a OpenCatalog. If I run the macro below with the administrator version, it'll prompt me for the access group and password before proceeding to the OpenReport statement, and this works fine. But if I run this with the user version, it doesn't prompt me and I'll hit an error at the OpenReport statement. Due to security reasons, I cannot encode password in the OpenCatalog statement in the macros. Please help me. Thanks.

Sub Main()
Dim objImpApp as Object
Dim objImpRep as Object
Set objImpApp = CreateObject("CognosImpromptu.Application")

Set objImpRep = objImpApp.OpenReport("c:\cognos\imp30\report11.imr")

objImpRep.RetrieveAll
objImpRep.ExportASCII("c:\abc.csv")
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub
 
Ice,

You may need to do an OpenCatalog call in the macro to make it work. Is the error you receive a true macro or Impromptu error, or is it just Impromptu asking for the location of the catalog? If it's the latter, then the users do not have a drive mapping to the location of the catalog. If it's the former, can you give more specifics on the error itself?

You can open the catalog in the macro and still have security in the passwords by encrypting the password and decrypting it on the fly. See thread401-305724 for more information.

Hope this helps,

Dave Griffin The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
 
Hi Dave,

Thank you very much for your reply. Maybe I can tell you in more detail about the problem I am facing.

I've been using the same PC when doing testing for both the administrator version and user version. The mappings and the system configurations are the same. So, if I want to test the user version, I would uninstall the administrator version and install the user version.

When I run the codes below in Administrator version (without the OpenCatalog statement), it will pop up a dialog box prompting me to logon to this catalog. After entering the catalog password, database user ID and database password, the codes work fine.


Sub Main()
Dim objImpApp as Object
Dim objImpRep as Object
Set objImpApp = CreateObject("CognosImpromptu.Application")

Set objImpRep = objImpApp.OpenReport("c:\cognos\imp30\report11.imr")

objImpRep.RetrieveAll
objImpRep.ExportASCII("c:\abc.csv")
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub


But when I run these codes in the User version, I encounter an error at the OpenReport statement - "R440 Impromptu: You have to specify the User Class Name when opening catalog in User version". If I add in this OpenCatalog statement below,

objImpApp.OpenCatalog "c:\cognos\imp30\cirrpt2.cat", "Report Section 1", "markone6", "prjcsc", "oracle8i"

it will then work properly. As there are a lot of users in my company with different user ids and passwords for different users, it'll not be practical to have a unique macro for every user.

I was wondering if there is any settings or configurations that I need to set on the user version so that the Catalog Logon dialog box would popup just like the administrator version when running this macro in the user version?


Regards
Clarence.
 
Clarence,

You can still use the OpenCatalog method, but not fill in the ID or password. Impromptu should open the catalog and wait for user input to fill in the catalog logins before proceeding. Add the optional 1 at the end of the method to force the macro to wait while the database is attached, as in:

ImpApp.OpenCatalog CatDir+"\"+Cat1,,,,,1

This should work. Let me know how it goes.

Regards,

Dave Griffin
The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
 
Hi Dave,

I follow your advise and add in the OpenCatalog statement in my codes, so it will look like this below.


Sub Main()
Dim objImpApp as Object
Dim objImpRep as Object
Set objImpApp = CreateObject("CognosImpromptu.Application")

objImpApp.OpenCatalog "c:\cognos\imp30\cirrpt2.cat",,,,,1

Set objImpRep = objImpApp.OpenReport("c:\cognos\imp30\report11.imr")

objImpRep.RetrieveAll
objImpRep.ExportASCII("c:\abc.csv")
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub


When I run this macro, it did not prompt me for the user id and password. Instead it encounters an error at the OpenCatalog statement and it reads "R440: Impromptu: You have to specify the User Class Name when opening catalog in User version".

Regards
Clarence.
 
Try this

objImpApp.OpenCatalog "c:\cognos\imp30\cirrpt2.cat","User Class",,,,1

Where "User Class" is the user class created on the catalog, Impromptu Administrator will default to the Creator User class which is created by default against every catalog. I suggest you create a user class of "Users" on the catalog and give them the required permissions.

making your code

objImpApp.OpenCatalog "c:\cognos\imp30\cirrpt2.cat","Users",,,,1

This should work Gary Parker
Systems Support Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top