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

Macro-Wait for Retrieval before print

Status
Not open for further replies.

1hrllabs

Technical User
Feb 21, 2005
19
0
0
US
I'm looking for the code to add to a macro that tells the program to wait until the retrieval is complete before sending the report to the printer.
 
welcome to Cognos Forms, 1hrllabs,
In order to help you, can you give a little more information?
What application are you using?
What is the relevant section of code that you have already?


soi la, soi carré
 
Using Version 7.1
Sub Main()
Dim objImpApp As object
Dim objImpRep As Object
Set objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.Visible True
objImpApp.OpenCatalog _
"s:\imp71_reporting_tools\BI04\Imp71_User\CATALOGS\Costpoint Catalogs\General Ledger.cat","Plan","hire1cop",,,1
Set objImpRep = _
objImpApp.OpenReport("s:\imp71_reporting_tools\joe's reports\green book\01-expenses by org.imr")
objImpRep.CloseReport
objImpApp.Quit
Set objImpApp = Nothing
Set objImpRep = Nothing
End Sub

Because the report takes a couple of minutes to run I get a message that the application isn't responding. Also, I would like to include the print function.

 
1hrllab,

If you want to show a message you must use a dialog. With this, you will show message and after it play a report.

Second, put application visible to false. With this user don't show impromptu and the message «application isn't responding» don't show.

For printing, show print/print out methods in documentation or help file.

Gilles.
 
1hrllabs,
GilMerc is correct. Add a line like
objImpRep.Print ,,1
after the OpenReport one

I usually add these lines after the open report
Set objImpRep = objImpApp.ActiveDocument
objImpRep.RetrieveAll
just in case the report has had the automatic retrieval removed.

lex

soi la, soi carré
 
I've changed the application visible to false and added the
report retrieval all line. Am still getting the "Server Busy" dialog box, with the message "This action cannot be completed because the [file name] is not responding"
 
1hrllabs,
that message just means that the script (macro) is running - in your case it means impromptu is still retrieving and formatting data. The macro will become visible and control return to the script editor when it has finished (or has reached an error).


soi la, soi carré
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top