Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Hyperlinking a text element to internal bookmark
actuser9
Is there a way to to create hyperlink on a text element to point to a internal bookmark in the report?
Find more posts tagged with
Comments
mwilliams
Creating a link to an internal bookmark is a little more work than a normal hyperlink because of the paginated viewer. I set up an example where I had a hyperlink table and a detail table. row["CUSTOMERNUMBER"] was my bookmark, as you'll see below. The viewer has a script that it calls to locate the bookmark and jump to it. This script won't work for a standard html output, so you have to catch any exception and try something else. This is what I put into my text control to make a hyperlink that worked in the viewer and html. This doesn't work for PDF. To do PDF, you should be able to check the outputFormat and simply create a href="#BookmarkValue" instead of the one below. Anyways, here is the text box content, which builds the bookmark link for the two html outputs:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<VALUE-OF format="HTML">"<a style=\"text-decoration: none;\" href = \"javascript:try{catchBookmark('" + row["CUSTOMERNUMBER"] + "');}catch(e){ try{parent.catchBookmark('" + row["CUSTOMERNUMBER"] + "');}catch(e){window.location.hash = '#" + row["CUSTOMERNUMBER"] + "';};};\">" + row["CUSTOMERNAME"] + "</a>"</VALUE-OF>
</pre>
<br />
Let me know if you have questions.
actuser9
Thanks Michael. The report needs to have the links in place for the pdf too. But I am keen on implementing this first.
Please let me know your thoughts on getting the hyperlinks on pdf.
mwilliams
I haven't tried this in Actuate BIRT yet, but the getOutputFormat() function returns "pdf" for the viewer, in OS BIRT, which is creating a problem with creating a different link for pdf. I'll let you know if I find a way to make it work.
actuser9
Just to let you know, I am using Actuate BIRT. If you have this method implemented in the report, can you please attach the report design file?
Thanks for all your support.
mwilliams
So far, I have a very messy report in 4.2.0 where I've been working on this. I can probably throw together a simple example, in BDPro, if you need me to. This concept should work in Actuate BIRT, too, though. Here is a way that you can get it to work with PDF, by checking the appContext for which render context is being used and building a different link if not HTML.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<VALUE-OF format="HTML">if (reportContext.getAppContext().containsKey("HTML_RENDER_CONTEXT")){"<a style=\"text-decoration: none;\" href = \"javascript:try{catchBookmark('" + row["CUSTOMERNUMBER"] + "');}catch(e){ try{parent.catchBookmark('" + row["CUSTOMERNUMBER"] + "');}catch(e){window.location.hash = '#" + row["CUSTOMERNUMBER"] + "';};};\">" + row["CUSTOMERNAME"] + "</a>"}else{"<a style=\"text-decoration: none;\" href = \"#" + row["CUSTOMERNUMBER"] + "\">" + row["CUSTOMERNAME"] + "</a>"}</VALUE-OF>
</pre>
actuser9
Hi,<br />
<br />
I am getting the below error.<br />
<br />
<blockquote class='ipsBlockquote' ><p>Internet Explorer cannot download.<br />
<br />
Unknown Error</p></blockquote>
mwilliams
I only tested using Chrome. I'll make an example with A11, now. I had to wait for an updated license key, to use it.
mwilliams
It appears that Actuate BIRT does not use the same javascript to do this. It looks like the Actuate Viewer just uses the full URL. So, all you'll need to do is build the link with the bookmark. Here's the link that the internal bookmark uses, for Actuate viewer:
http://127.0.0.1:55216/iportal/servlet/GenericRedirector?command=iv&__report=/$$$Transient/acfile78.rptdocument&__design=C:/Users/mwilliams.HQ/workspace/Actuate+11/Actuate+11/CustomBookmarkHyperlink.rptdesign&__locale=en_US&__vp=workgroup&__masterpage=true&__svg=false&__bookmark=141&__newWindow=false
actuser9
hi Michael,
Thanks for the info. I will let you know how it goes.
Regards
UY