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!

Macro Question

Status
Not open for further replies.

Swathi37

Vendor
Dec 23, 2002
77
US
Hi All

I have a question regarding Macro.

Is it possible to run 8 .imr reports by using a single macro and save it as a .csv file.
Each report has more than a million records that needs to be converted to csv file.
Do you have the code?


Thanks for your help
Regards
Swathi.
 
Here is what I've got.
ImpDoc(n,2)
ImpDoc(1,1) = "report name"
Impdoc(1,2) = "Catalog name"
...
ImpDoc(n,1) = "report name"
Impdoc(n,2) = "Catalog name"

Set ImpApp = CreateObject("CognosImpromptu.Application")
ImpApp.Visible 1

for j = 1 to n

ImpApp.OpenCatalog (ImpCatPath & ImpDoc(j,2) ), "*****", "*****",
Set ImpRep = ImpApp.OpenReport (ImpRepPath & ImpDoc(j, 1) & ".imr")
ImpRep.Visible 1
ImpRep.RetrieveAll
ImpRep.ExportASCII(PDFSaveFolderName & ImpDoc(j, 1)& ".csv"),0

ImpRep.CloseReport
Set ImpRep = Nothing
Set PDFPub = Nothing
ImpApp.CloseCatalog

next j

ImpApp.Quit
Set ImpApp = Nothing


End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top