How to set target window of hyperlinks in Reporting Studio?
5 answers
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:
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)
Result:
Clicking on the link will open it in a new window.
Best Regards,
Francesco Chiossi
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)
Result:
Clicking on the link will open it in a new window.
Best Regards,
Francesco Chiossi
Comments
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?
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
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
@a168687
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
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
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)
@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
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.
URL:
Line:266
Character:3879
Source: