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

Use Macro to filter a report

Status
Not open for further replies.

suchis

MIS
Jun 6, 2003
8
BM
I would like to know how to filter a report by using a Macro.
 
Hi CognosProfessional, are you refering to the Macro help files because, I am not familiar with the Macro cookbook. Where do we find this ? :->
 
In Cognos install CD,there are many books about cognos products.
 
here is how to choose the filter of a report to use "black" since there are many colors of wrenches, and would like each color run with the same report separately and saved to a pdf.

Sub Main()
Dim objImpApp as Object
Dim objImpRep as Object
Dim objPublishPDF as Object
Dim FinalFilePathName as String
'*************************
Set objImpApp = CreateObject("Impromptu.Application")
objImpApp.Visible True
objImpApp.OpenCatalog "\\ServerName\SN1\Rpts\catalogs\HDW.cat","creator",,"dbase","password"
Set objImpRep = objImpapp.OpenReport("\\ServerName\SN1\Rpts\pdfs\Wrenches.imr","black")
objImpRep.Retrieveall
Set objPublishPDF = objImpRep.PublishPDF
objPublishPDF.Publish("\\ServerName\SN1\Rpts\PDF\Hardware\black\Wrenches_black.pdf")
objImpRep.CloseReport
Set objImpRep = objImpapp.OpenReport("\\ServerName\SN1\Rpts\pdfs\Wrenches_QTR.imr","black")
objImpRep.Retrieveall
Set objPublishPDF = objImpRep.PublishPDF
objPublishPDF.Publish("\\ServerName\SN1\Rpts\PDF\Hardware\black\Wrenches_black_QTR.pdf")
objImpRep.CloseReport
objImpApp.Quit
Set objImpRep = Nothing
Set objImpApp = Nothing
End Sub
---------------------------------

CP [cook]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top