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

Hi, I need to creat a CognoScrip

Status
Not open for further replies.
Mar 6, 2003
157
0
0
JO
Hi,

I need to creat a CognoScript macro to be able to burst reports in Impromptu (without using IWR) per salesrep. How would I proceed in creating this macro?

Regards,
Shawn
 
Shawn,

There are two ways to do this, depending on whether your list of salesreps to run are userclasses in your catalog, or just data. Assuming they are just data, is it a simple, static list, or is it a longer and dynamic list? A short static list can be programmed into the macro as a static array. A longer dynamic list can be populated into an array in the macro via either an Impromptu report using the GetDataValue call, or read from the database with a direct SQL ODBC call.

Once the list is in the macro, it is just a matter of running the report in a repetitive loop, using the current value of the salesrep as a report prompt.

So, create an array, fill it with the salesreps to filter each report on, then run the report for each salesrep by calling the report from within a For ... Next Loop.

How you handle the output depends on your needs. You can create a PDF file for each salesrep, or you could even email the file to each salesrep if you could associate an email address with their salesrep filter value, depending on your email client and its API.

This would not be a easy macro for a beginner, but it is possible with some work.

Look over the sample macro, the macro help file, and come back with questions.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Shawn
Dave has answered your question correctly, but if I understand what you mean by bursting correctly- why use a macro? Want I believe you want is to be able to produce a report for each salerep, starting at a new page for each. If I'm wrong, quit here!

You could do this by grouping by salesrep. To do the pagination, go into the List Properties and turn Page Break Before:On for the salesrep group. You could also set 'Reset the page number on:' to salesrep, so that each report starts at page 1.
If you are concerned about output as Dave describes, ignore what I've said as it could only be achieved using a macro.

Simon Rouse
 
Hi DrSimon

Thanks very much for your post. I would like to burst the salesrep report into multiple PDFs per salesrep automatically. Thus, I will need a macro after all.


Regards,
Shawn
 
If it's not much trouble, could I impose on you to post this macro, if done? We just upgraded to 7.1, and I can't get the bursting to work via Upfront (anyone else have this problem)? They run as personal reports, but when you go to make 'administrator' as the user class to burst the report, userclass list comes back empty. #@%&* Cognos bugs!!! My boss turned 3 colors and went ballistic. It's be a real coup if there's a macro that can successfully burst to many (>150) user classes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top