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!

keeping the dialog box open while running report-cognos script

Status
Not open for further replies.

aminaalavi

Programmer
May 22, 2003
15
0
0
FR
I have created a number of dialog boxes. The buttons in the dialog boxes open up .imr reports. Once the button is clicked the dlg box dissapears and the reports opens. Then i call the dlg box again so that the user may choose some other report. However, the dlg box comes on top of the report as soon as it opens. Is it possible to
1) keep the original dlg box open or
2) bring the report to the front of the desktop with some function ( tried object.activate but is not working or
3)somehow know that the user closed the report and then i call the dlg box.

Thanks
Amina
 
Amina,

Similar to your last post, I would suggest you put the execution line for the dialog box in a Do loop. Keep it there until the user cancels the dialog, rather than an OK or Cancel. This keeps the dialog up even after the report is launched.

You may have to work on code to ensure that the report regains focus (i.e. is on top) after the dialog box re-executes. This maybe a little tricky. You will have to run the objImpApp.Activate method from within a dialog function, as the loop will run the report when the OK is selected, and then re-run the dialog box after the report execution. I've never done this, but it may be possible. It will let you know with a compile error (or less likely a runtime error) if this cannot be done.

Option 3 involves polling and can have bad effects as the macro continues to actively execute in the background rather than just waiting for input, so I wouldn't recommend it unless the above method proves unworkable. If you need to do this, then create another Do loop and check for the existence of either an active document or the application itself with a delay timer, and then exit the loop and relaunch the dialog when either happens. Bad things may happen in the macro if the end user closes Impromptu and the macro still has the Impromptu object defined and tries to access it though.

Good luck and let us know how it works out.

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ20-2863 first!
 
DearDave,
I have tried putting it in a loop and then placing the objImpApp.Activate method at various different places but for some reason the activate method does not work ( not that it gives an error. I am still working on this issue, will let you know how i progressed.

Thanks a lot for your help Dave :)

Amina


 
Dear Dave,

I discovered that since the dialog boxes are interactive in cognos script, even if i have the function obj.activate right after the call to the dialog box, it will not excute until the user interacts ( that is clicks some button on the dialog box), THat is the reason why obj.activate might not work here. But i found a way to wrok around. I call a minature dialog box ( so that it does not cover the report and does not annoy the user) right after report execution with only one button which when clicked leads to the main menu. It is kind of like the "help" paper clip that appears when word opens.

Thanks a lot for all your help though

Amina
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top