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!

Cognos 7.4 macro. Problem with promt an auto report

Status
Not open for further replies.

hell2010

IS-IT--Management
Sep 29, 2010
7
DE
hallo together.
i work with cognos impromptu 7.4 and i want to use an macro to export my report into xls-file.
i have 2 variable which i have to enter manual when report open.

when i use my macro the report open but the script stop by asking for the variable an i have to press OK manual.

part of my code:

promptval1 = strVar1+","+strVar2

ErrorCount = 0
Set objImpApp = CreateObject("Impromptu.Application")
Set objImpRep = CreateObject("Impromptu.Application")
objImpApp.Visible -1
objImpApp.OpenCatalog strCatalog, "Endanwender"
Set objImpRep = objImpApp.OpenReport(strReport,promptval1)
objImpRep.RetrieveAll
objImpRep.ExportExcelWithFormat (strFile)
objImpRep.CloseReport
objImpApp.Quit
Set objImpApp = Nothing
Set objImpRep = Nothing


how can i open the report, set the variable an export the report to exel automatically

thanks a lot
 
hell2010,
You need a pipe character ("|") between your variables, not a comma.

soi là, soi carré
 
Hallo drlex.

when i use the pipe the script stop by showing the prompt with only one correct variable.

by using comma the two variable will enter correctly but the script stops too.

 
Is it possible that strVal1 and/or strVal2 do not contain valid values?
I notice that the line
Code:
Set objImpRep = CreateObject("Impromptu.Application")
is unnecessary, in that you have already created the object in the prior line. This duplication may be affecting operation.

soi là, soi carré
 
i found the solution.

you are right. the var's are date-values and i used the wrong format. i used the format that is shown in the prompt and not the format that cognos need.

thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top