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!

macro problems with reports using datasets

Status
Not open for further replies.
Sep 20, 2002
20
GB
I have a report that references a dataset to exclude data from the report e.g. where not x in [dataset] (both using the same catalog) which works perfectly when opened in impromptu itself. However, when I write a macro to run the report and export the data so that it can be run nightly the macro crashes with error number 24634. The only thing I can think that could be causing this is that the macro engine can only run one report at a time. Is there any way around this or a better way to run the report automatically?
 
p.s. I'm running the macro on an NT4 server and using impromptu 6 against an oracle database
 
whats the first sign of madness? answering your own threads on forums??? seems like it to me...

I have worked out (by messing with VB6) that the above problem is actually to do with the report engine i.e. impadmin.exe

it seems what you can do in impromptu the app you can't always do in the API... ho hum
 
Steve,

Can you explain a little more? It sounds like you are getting inconsistent results or errors using one of the .Export methods in the API as compared to using the SaveAs option interactively. Other than Formatted Excel, I'm not aware of other limitations between the two.

Oh, and by the way to anyone interested, Cognos now says that the next release (MR2?) of Impromptu will support both XML output AND will fix the formatting problems that have plagued the HTML output option. (per their Update day in DC on Wednesday 9/18/02). I'd love to see these happen.

Regards,

Dave Griffin
The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
 
The problem is not in the report. If I open the report in Impromptu it works fine and I can export it, etc... However, when I try to open the report from within a cognos script macro the report fails with an error number of 24634.

I copied the macro into VB to see if the problem lay in the macro application but it still fails when it tries to open the report so it must be a problem with the cognos script API...

The report itself uses a dataset to exclude sales orders of a certain type from the main report...

here is the guts of the macro... maybe its a problem in the way i've written it?

set objimpapp = createobject ("CognosImpromptu.Application")
set objimprep = createobject ("CognosImpromptu.Application")
objimpapp.opencatalog "e:\cognos\catalog\MIS.cat", _
"Creator", "","report", "report"
set objimprep = _
objimpapp.openreport ("e:\cognos\MIS\SalesFigures.imr")
objimprep.retrieveAll
objimprep.exportexcel ("e:\cognos\MIS\SalesFigures.xls")
objimprep.CloseReport
 
Steve,

You've already defined objimprep as an instance of Impromptu itself. (2nd line of the macro). You can't then redefine it as a report opened by the first instance of Impromptu (line 4 of macro). rem out the second line and see if everything proceeds normally. You don't need or want to open instances of Impromptu here.

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