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

Creating report via macro

Status
Not open for further replies.

bebbo1986

Programmer
Feb 12, 2008
43
DE
Hallo,
I'm using Cognos PowerPlay 7.3 and I'm not yet an expert. But it's getting better. Now I need to create a report via macro (*.mac). And I heard the macros are related to VB and this programming language I know.

My questions: Is these possible? How are the commands for creating a report (insert columns, select data, insert rows)? How is the structure of such a code?

Thanks.
 
Can you explain a little about what you are trying to do?
You don't necessarily need a macro to create a PowerPlay report, generally a "report" in the PowerPlay environment is just a particular saved view of the cube.
Having said that, there are things you can only do with macros, though I couldn't tell you what. See "Macro Language Help" in the CognosScript Editor, and the "CognosScript Macro User Guide" in your documentation menu for command and structure information.
 
Thanks for your tips. I will now try to describe my problems more detailed. When you have further questions, feel free to ask.

The data in my cube is divided in year and dealer (and more) and I want to create a report for the year 2006, 2007 ... and that for every single dealer of over 20 dealers.
And then these reports should be exported in Excel (I have read how that is possible)

And later I wish a prompt at the beginning of my macro, where the user can choose a dealer for which a report will be exported then.
 
bebbo1986,
Since you are acquainted with VB, then it should be easy for you to construct such. What almeids has suggested is the best plan, bearing in mind that the available commands are better suited to opening and manipulating an existing report than construction de novo.

In the help file or documentation, look at the DimensionLine, Children and Count properties of a powerplay report object. The examples work with the example model(s) provided in a standard install.

soi la, soi carré
 
If you are looking to fully automate it then a macro is the way to go and I don't think you'll have any problem doing what you've described. An alternative lower-tech approach would be a view of the data in the shape you want, and users could just select the dealer they want from the dimension line pulldown and export to Excel. A couple more clicks for the user but no programming involved...just a thought.

 
I thank you very much. Perhaps you're right and now I can manage to solve the problem.

I think the easiest way is to create one report and the change the filters via macro.

Could you just please tell me the command to change a filter say with the first Dimension "Period". That would be great.

Thanks.
 
Oh I think I found the answer:

objPPRep.DimensionLine.Item("Periods").Change("2006")

But surely I will have further questions in the next days.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top