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

How to pass prompt values from a macro to sub-reports?

Status
Not open for further replies.

cognos4user

Technical User
Apr 21, 2003
4
US
Does anybody know how to pass prompt values to sub-reports or it's out of question when using macros? It looks like that 'OpenReport' method does not apply to sub-reports or it does but does not pass values to sub-reports or I am completely off the subject. Please, give me any idea on this account, I am new to writing macros for cognos.

Cheers,
Dmitry
 
cognos4user,

Never even considered putting a prompt into a sub-report before [ponder]. Usually I filter the sub-report based on prompt values in the main query. Try defining a calcuated column in the main query to be equal to a prompt you define there, and then use this in the sub-report instead. This column does not have to be visible in the report to make this work. This should fix the issue of not being able to feed the prompt value into the sub-report via the macro.

Hope this helps,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ20-2863 first!
 
Thank you, Dave for the prompt response([medal]). I realized that the macro should work in my case and the problem was that several prompts were using values with commas, e.g. 'Company, Inc.'. This likely confused my macro into thinking that there were two values passing to the prompt instead of one and the report did not display anything ([sadeyes]). I have to switch prompts in the reports to using something like company code which I hope will fix the problem.

Dmitry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top