BIRT: How can I add a popup window to a link within a report?
Hi
I would like to have a Birt Report with WI with link to the WorkItem itself and with Hoover.
I've found an interesting wiki info for Hover but I've no clue where I should add this code :-( in my report
see latest FAQ of https://jazz.net/wiki/bin/view/Main/ReportsBIRTFAQ
Thanks
erwin
4 answers
Comments
Hi Vladimir Thanks fo your feedback. Actually I started with this document to try to do it. For the Listing14 I was not really sure where to put, but i did the listing 13 on Master Page. When running the report I just had the code visible as header and in the field. What do I miss? is there a special attribute I need to set? Where do i have to put the Listing 14
My report is simple, mostly based on the tutorials of this 3 article
Don't forget I'm a newby ... very new :-( Or may I send you my report ...
Thanks erwin I
On the Master Page you add code from listing 13, make content type = HTML and check visibility property (to hide the code from generated report itself).
As for data element (which you need to be "hover-enabled") also select content type = HTML and fill it with code from listing 14.
Also a good idea is to use ot-of-the-box reports as samples for such tricks. In case this information is not enough, I can send you very simple template with hover pop-ups enabled.
Hi Vladimir, maybe you can simply post the XML of your simple example in an answer to this question? I'm also interest to see it.
Hi Vladimir. Sorry to bother you further. in the master page i added in the header a text object, type HTML, hiden and put the code. In the field summary i added a text field HTML, hiden and put the other code where I modified the URL. The Hyperlink is set on the summary and is working. Thats the code I put:
<a target="_self" class="jazz-app-ResourceLink" id="jazz_app_ResourceLink_<value-of>row["WI_ID"]</value-of>" href="https://myserver/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/ <value-of>row["WI_ID"]</value-of>"> <value-of>row["SUMMARY"]</value-of> <code style="display:none"> <script> titleLink = document.getElementById("jazz_app_ResourceLink_<value-of>row["WI_ID"]</value-of>"); new jazz.app.ResourceLink({retainLinkText: true},titleLink); if (titleLink.lastChild.nodeName == "IMG"){ titleLink.removeChild(titleLink.lastChild); }; </script> "
Thank you
Great! Does hovering over link also work? Can you see pop-up window with work item details?
I could have written it :( Nope, nothing happens. No idea where to look at! Should it also come in the birt editor... probably not. How can I debug?
No, hover works in RTC UI only. What browser do you use? It works for sure in IE8 and FF 3.6. Add site to Intranet Zone to avoid any security issues with javascript. Also make sure you don't have duplicate links in report (in this case code should be modified to make distinct resource links).
i know its a Bit of work, but could you send me a report or at least check the XML extract below. thanks erwin
Im using IE8 Local Intranet/Protected Mode:on
and FF ESR 10.7 (it's the entreprise version based on 3.x suported by Jazz)
You mean on the same page the sam workitem hyperlink..nope that is not the case
here the xml of the summary cell
<cell id="176">
<text id="649">
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr" type="javascript">true</expression>
</structure>
</list-property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<a target="_self" class="jazz-app-ResourceLink"
id="jazz_app_ResourceLink_<VALUE-OF>row["WI_ID"]</VALUE-OF>"
href="https://myserver/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/
<VALUE-OF>row["WI_ID"]</VALUE-OF>">
<VALUE-OF>row["SUMMARY"]</VALUE-OF></a>
<code style="display:none">
<script>
titleLink =
document.getElementById("jazz_app_ResourceLink_<VALUE-OF>row["WI_ID"]</VALUE-OF>");
new jazz.app.ResourceLink({retainLinkText: true},titleLink);
if (titleLink.lastChild.nodeName == "IMG"){
titleLink.removeChild(titleLink.lastChild);
};
</script>
</code>
]]></text-property>
</text>
<data id="251">
<property name="resultSetColumn">SUMMARY</property>
<structure name="action">
<property name="linkType">hyperlink</property>
<expression name="uri" type="javascript">var serverURL = reportContext.getAppContext().get("SERVER_URL");
if (serverURL == null) serverURL = "";
serverURL + "/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/"+row["WI_ID"]</expression>
<property name="targetWindow">_blank</property>
</structure>
</data>
</cell>
<text id="3786">
<list-property name="visibility">
<structure>
<property name="format">ppt</property>
<expression name="valueExpr" type="javascript">true</expression>
</structure>
<structure>
<property name="format">doc</property>
<expression name="valueExpr" type="javascript">true</expression>
</structure>
<structure>
<property name="format">postscript</property>
<expression name="valueExpr" type="javascript">true</expression>
</structure>
<structure>
<property name="format">pdf</property>
<expression name="valueExpr" type="javascript">true</expression>
</structure>
<structure>
<property name="format">xls</property>
<expression name="valueExpr" type="javascript">true</expression>
</structure>
</list-property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<a target="_self" class="jazz-app-ResourceLink"
id="jazz_app_ResourceLink_<VALUE-OF>row["WI_ID"]</VALUE-OF>"
href="/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/<VALUE-OF>row["WI_ID"]</VALUE-OF>"><VALUE-OF>row["SUMMARY"]</VALUE-OF></a>
<code style="display:none">
<script>
titleLink =
document.getElementById("jazz_app_ResourceLink_<VALUE-OF>row["WI_ID"]</VALUE-OF>");
new jazz.app.ResourceLink({retainLinkText: true},titleLink);
if (titleLink.lastChild.nodeName == "IMG"){
titleLink.removeChild(titleLink.lastChild);
};
</script>
</code>]]>
</text-property>
</text>
Comments
Hi Vladimir
Since the snippet ist html and this page is html, part is not shown :-)
When you post html you need to replace < with <
anyway, could you send it to me erwin.kunz@siemens.com
Many thanks. I really appreciate your help
RTC 3.0.1.4
Sent via e-mail.
Hi Vladimir,
Check your mail, Qi.
Hi Vladimir, It seems the pop-up windows doesn't work on my FF10.0, IE or Chrome, do you have solutions on how to make it insensitive to different browsers? Thanks!
Sorry, have no idea.