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!

Cannot open .imr reports through macro in the User version

Status
Not open for further replies.

aminaalavi

Programmer
May 22, 2003
15
0
0
FR
I have developed a number of dialog boxes with buttons which when clicked, open reports.

Using the administrator version of Impromtu, I am able to open the .imr reports however, when using the macro with the USER version of impromtu, I are not able to open the reports. IT gives me an error message that the path has been changed.

In tool\option\file locations I have specified the location of the reports and the catalog and in the macro just open the report using the following command :
impobj.openreport('reportname.imr'). I cannot specify the path name as the user may have his file in whatever location they want to place it in.

Could you please let me know why this error is occuring and what is the solution. given below is a smaller version of my macro.

declare sub tvlshowdlg


sub main

call tvlshowdlg

end sub



sub tvlshowdlg()



Begin Dialog UserDialog3 25, 7, 595, 322, "TRAVEL"
ButtonGroup .ButtonGroup1
PushButton 167, 108, 271, 24, "1. LIST OF TRAVEL AUTHORISATIONS (tabyname.imr) "
CancelButton 295, 295, 73, 17
Picture 155, 2, 271, 24, "travel.bmp", 0
End Dialog

Dim mydialogbox3 As UserDialog3
answer3= Dialog(mydialogbox3)

Select Case answer3

Case 1
Dim ImpApp1 As object
Set ImpApp1 = CreateObject("CognosImpromptu.Application")
ImpApp1.Visible 1
ImpApp1.OpenReport("tabyname.imr")
ImpApp1.WindowState = 1
Set ImpApp1 = Nothing



End Select


end sub


thanks a lot

Amina
 
hi amina,

The user version can NOT open a catalog as creator, the aministrator version can. If you open a report the catalog is opened as creator.

You should add a userclass to your catalog (if you don't have one already)and you should add a line to your macro which forces the macro to open the catalog as a different user like:

objImpApp.OpenCatalog &quot;C:<path>\catalogname.cat&quot;,&quot;creator&quot;,,&quot;sa&quot;,&quot;sa&quot;

Use the help in the acro editor to see which parameters you need.

good luck!

Christenhusz
 
Hi Christenhusz


Thanks a lot for the advice. Now i understand why the user version was behaving differently from the impromptu version. I will implement your suggestion right away.

Thanks

Amina
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top