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

Parameter Ignored in Hyperlink

Status
Not open for further replies.

qberta01

Programmer
Nov 14, 2005
113
I have created a hyperlink that opens another report. I would like it to also pass a parameter value to the report. The parameter in the second report is optional.
I am able to open the report via the link, but it does not limit data based on the paramater. I followed the structure given in the Cognos documentation:

cognos.cgi?b_action=xts.run&m=portal/launch.xts&&ui.tool=CognosViewer&ui.object=
/content/package[@name='GO Sales and Retailers']/folder[@name='New
Reports']/report[@name='product revenue - prompt']&ui.action=run&p_Product name=Bear
Edge&run.prompt=false

What could I be doing wrong? I wonder if I have not named my prompts correctly in the report. Given the example above
would the parameter for the prompt be named p_Product Name or Product Name?

I am using BI 8.4

Any help is appreciated.

Q.
 
Using your given sample, the paramater name in the report would be 'Product name'. If you want to provide a value for a paramter on a URL, you have to add a leading 'p_' to the paramter name.

You should avoid spaces in the parameter names, or at least you should escape them in the URL with %20 (I've never tried it using spaces on the URL).

Example:

[@name='GO Sales and Retailers']/folder[@name='NewReports']/report[@name='product revenue - prompt']&ui.action=run&p_Product%20name=BearEdge&run.prompt=false

Maybe that helps
 
Thanks for the info and tip. I actually don't have any spaces in my URL...I was just copying verbatim from the Cognos doc. I am now able to pass the parameter, but only if it's hard coded. How do I actually pass in the prompt value from the first report? I tried:

p_Value=?prompt? (actual prompt value)
p_Value=prompt (name of prompt search and select)

Also, is it possible to pass more than one value through the URL. For example productname in ('x','y','z')

thx for your help.

Q.
 
To pass parameter values from one Report Studio report to another you have to use a Report Expression for the source of the hyperlink element instead of a static text.

So in the properties of the hyperlink element select as source 'Report Expression' and use something like the following as expression:

"[@name='GO Sales and Retailers']/folder[@name='NewReports']/report[@name='product revenue - prompt']&ui.action=run&run.prompt=false&p_Product%20name=" + ParamDisplayValue('Product name')

You may also want to consider using the default Drill Through functionality instead.

For passing multiple values for one parameter you can pass one single value for one parameter multiple times, e.g.:

...&p_Product%20name=a&p_Product%20name=b&p_Product%20name=c

Hope that helps
 
Great Thanks! That worked. I wasn't using a drill through because I thought that could only be done on a list. I clicked around for drill through, but did not see the option. I must have been clicking on the wrong thing. Silly me. I can do a drill through on a text item. However, understanding the hyperlink and passing parameters will come in handy for other reports on my list.

thx again.

Q.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top