It's all about the answers!

Ask a question

How to set target window of hyperlinks in Reporting Studio?

Rhishikesh Patil (1311227) | asked Sep 23 '14, 3:20 a.m.
edited Sep 23 '14, 5:29 a.m. by Francesco Chiossi (5.7k1819)

We are using Cognos Reporting Studio 10.1.1, and we want to set property of hyperlinks to open in new tab/window when clicked. Can we do such settings? and how?

Thanks in advance for your help

5 answers

permanent link
Francesco Chiossi (5.7k1819) | answered Sep 23 '14, 5:21 a.m.
edited Sep 23 '14, 5:22 a.m.
Hello Rhishi,

you can try something like this:

1) Create a new data item (let's call it Link) in your query with the following expression to build an HTML link:

where [URL] is the data item in the query containing the hyperlink.

2) Add an HTML Item to your list in the report

3) Set the HTML Item properties as follow:
- HTML Source > Source Type > Data Item Value
- HTML Source > Data Item Value > Link (the data item created at point 1)


Clicking on the link will open it in a new window.

Best Regards,

Francesco Chiossi

Rhishikesh Patil commented Oct 07 '14, 7:52 a.m.

Thanks @Francesco Chiossi i am using hyperlink instead of HTML item could you please guide me on how to implement this for Hyperlink item from toolbox?

Francesco Chiossi commented Oct 07 '14, 7:59 a.m.

Hello Rhishi,

I don't think this is possible with an hyperlink item as you need to alter a part outside of the URL itself.

Best Regards,

Francesco Chiossi

Francesco Chiossi commented Oct 07 '14, 8:03 a.m.

Hello Rhishi,

I don't think this is possible to achieve with an hyperlink item, as it requires a manipulation outside of the URL.

Best Regards,

Francesco Chiossi

permanent link
Francesco Chiossi (5.7k1819) | answered Nov 14 '14, 5:48 a.m.
edited Nov 14 '14, 5:49 a.m.
Hello Sarika,

in my example the HTML fragment is build like this:

You can replace the second [URL] item, with whatever you want to display as the link text.

Best Regards,

Francesco Chiossi

permanent link
Sarika Saxena (62) | answered Nov 06 '14, 7:12 a.m.
edited Nov 11 '14, 10:18 a.m.
I have two columns, Name and Link, I used the hyperlink item to display the Name (text source)and Link (URL source) but the link opens in the same tab. If I use the HTML item, how can I make it display the Name and have the source URL as the Data item Value of Link as for the HTML item I only see HTML source.

So for example I want to display in the below, instead of the long URL some smaller text (Workitem 55)

permanent link
Sarika Saxena (62) | answered Nov 18 '14, 5:58 a.m.
Thanks a lot, it works!!

permanent link
shiv kumar (11) | answered Oct 13 '20, 3:55 a.m.
edited Oct 13 '20, 3:57 a.m.

 @Francesco & @Sarika Saxena I am using cognos 11.1.7, I have exact same business requirement and implemented your approach{'<a href="'+[URL]+'" target="_new">'+[URL]+'</a>'}. I am getting the below error 

 HTML report output is not well formed. If your report uses "HTML Item" elements ensure that they result in well-formed HTML.

Reason:A semi colon character was expected.


Your answer

Register or to post your answer.