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

Impromptu Macro To Print ?? 1

Status
Not open for further replies.

zxzzzzzz

Programmer
Jul 10, 2002
51
US
Can anyone tell me if it is possible to specify a certain network printer within your macro to print an Impromptu Report????

Thanks!
 
GB65,

Try the following lines in your macro:

PtrClr$ = "\\netserver\devicename" 'Your network printer

CPApp.FileSetPrinter PtrClr$

Hope this helps,

Dave Griffin
The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
 
I tried this, and I'm getting a compile error on the CPApp line. Here is my code (maybe I didn't put the lines in the right place? Macros are new to me!)

Sub Main ()
Dim objImpApp as object
Dim objImpRep as object
Set objImpApp = Createobject("CognosImpromptu.Application")
ObjImpApp.OpenCatalog "q:\Catalogs 7.0\DMSAU_data.cat", "Developer"
Set objImpRep = objImpApp.OpenReport ("q:\DMS CUSTOM REPORTING\PO Reports\DMSAU REPORTS\DMS PO PRINT.imr")
objImpRep.RetrieveAll
PtrClr$ = "\\netserver\devicename" 'Your network printer
CPApp.FileSetPrinter PtrClr$
objImpRep.PrintOut ,,1
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub

Thanks!!
 
Sorry GB65,

I'm using an OEM version. In your macro change the call to:

objImpApp.FileSetPrinter PtrClr$

rather than

CPApp.FileSetPrinter PtrClr$


Sorry again,

Dave Griffin
The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top