COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: pammassey on 02 Mar 2017 07:59:58 AM

Title: Hyperlink in list report that opens to an outside URL - open in new window
Post by: pammassey on 02 Mar 2017 07:59:58 AM
I have set up a hyperlink to a product code that goes to an outside URL.  The URL is working fine, but I need it to open in another window.  Right now it opens in the same window.  Any help?  The hyperlink is set up with a Text Source type as Data Item Value pointing to the product code, and the URL source type is a data item value pointing to a data item I set up with the URL of 'http://webapp/scripts/cgiip.exe/dh.w?Request=GetProdInfo&Params=' || [Model No.].
Title: Re: Hyperlink in list report that opens to an outside URL - open in new window
Post by: AnalyticsWithJay on 02 Mar 2017 08:41:36 AM
Unfortunately Cognos doesn't have a property for this feature (boggles my mind). You have to use an HTML item instead using the following syntax:


'<a href=''http://webapp/scripts/cgiip.exe/dh.w?Request=GetProdInfo&Params=' + [Model No.] + ''' target=_blank> Replace Link Text Here </a>'


Of course you'll need to change the text source to Report Expression.
Title: Re: Hyperlink in list report that opens to an outside URL - open in new window
Post by: Deep750 on 03 Mar 2017 05:52:46 AM
It should work, as Jay has suggested.

Another recommendation is to implement the URL in framework manager (FM), so that any changes to the URL, in the future, can be changed in FM, instead of changing it in multiple reports.

This is how I have implemented it, in bus.layer:
I have two calculations, in addition to the product code-object.
[URL]
'http://URL/Details?CaseId='
[SITE]
'<a href=' +  [URL] +  [PRODUCT_CODE]  + ' target="_new">SITE_NAME </a>'