It's all about the answers!

Ask a question

BIRT: How can I add a popup window to a link within a report?


Erwin Kunz (94687086) | asked Sep 24 '12, 11:04 a.m.
edited Sep 24 '12, 11:05 a.m.

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



permanent link
Vladimir Amelin (70472226) | answered Sep 25 '12, 5:29 a.m.
In several words you should modify Master Page and HTML element. Example here:

It works in my reports in RTC 3.x


Comments
Erwin Kunz commented Sep 25 '12, 10:52 a.m.

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


Vladimir Amelin commented Sep 25 '12, 11:30 a.m. | edited Sep 25 '12, 11:32 a.m.

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.


Guido Schneider commented Sep 25 '12, 3:52 p.m.

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.


Erwin Kunz commented Sep 26 '12, 3:28 a.m. | edited Sep 26 '12, 3:33 a.m.

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


Vladimir Amelin commented Sep 26 '12, 4:02 a.m.

Great! Does hovering over link also work? Can you see pop-up window with work item details?


Erwin Kunz commented Sep 26 '12, 7:30 a.m.

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?


Vladimir Amelin commented Sep 26 '12, 7:39 a.m.

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).


Erwin Kunz commented Sep 26 '12, 4:18 p.m.

i know its a Bit of work, but could you send me a report or at least check the XML extract below. thanks erwin 

showing 5 of 8 show 3 more comments

permanent link
Erwin Kunz (94687086) | answered Sep 26 '12, 8:11 a.m.
edited Sep 26 '12, 8:15 a.m.

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 
 
                                    &ltcell id="176">
                                        &lttext id="649">
                                            &ltlist-property name="visibility">
                                                &ltstructure>
                                                    &ltproperty name="format">all&lt/property>
                                                    &ltexpression name="valueExpr" type="javascript">true&lt/expression>
                                                &lt/structure>
                                            &lt/list-property>
                                            &ltproperty name="contentType">html&lt/property>
                                            &lttext-property name="content">&lt![CDATA[&lta target="_self" class="jazz-app-ResourceLink"
id="jazz_app_ResourceLink_&ltVALUE-OF>row["WI_ID"]&lt/VALUE-OF>"
href="https://myserver/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/
&ltVALUE-OF>row["WI_ID"]&lt/VALUE-OF>">
&ltVALUE-OF>row["SUMMARY"]&lt/VALUE-OF>&lt/a>

&ltcode style="display:none">
&ltscript>
titleLink =
document.getElementById("jazz_app_ResourceLink_&ltVALUE-OF>row["WI_ID"]&lt/VALUE-OF>");
new jazz.app.ResourceLink({retainLinkText: true},titleLink);
if (titleLink.lastChild.nodeName == "IMG"){
titleLink.removeChild(titleLink.lastChild);
};
&lt/script>
&lt/code>
 

]]>&lt/text-property>
                                        &lt/text>
                                        &ltdata id="251">
                                            &ltproperty name="resultSetColumn">SUMMARY&lt/property>
                                            &ltstructure name="action">
                                                &ltproperty name="linkType">hyperlink&lt/property>
                                                &ltexpression name="uri" type="javascript">var serverURL = reportContext.getAppContext().get("SERVER_URL"); &#13;
if (serverURL == null) serverURL = ""; &#13;
serverURL + "/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/"+row["WI_ID"]&lt/expression>
                                                &ltproperty name="targetWindow">_blank&lt/property>
                                            &lt/structure>
                                        &lt/data>
                                    &lt/cell>


Comments
Vladimir Amelin commented Sep 27 '12, 2:40 a.m.

Code looks OK, my example is below (could not insert in comment for some reason). What version of RTC do you use?  


permanent link
Vladimir Amelin (70472226) | answered Sep 27 '12, 2:35 a.m.
edited Sep 27 '12, 2:37 a.m.
 My report template is quite complex (more than 1Mb), so here is code of text element used to display pop-ups on hover. Make sure you have both row["SUMMARY"] and  row["WI_ID"] as data set results.

 

                                    <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
Erwin Kunz commented Sep 27 '12, 3:25 a.m. | edited Sep 27 '12, 3:26 a.m.

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 &lt

anyway, could you send it to me erwin.kunz@siemens.com

Many thanks. I really appreciate your help

RTC 3.0.1.4


Vladimir Amelin commented Sep 27 '12, 3:33 a.m.

Sent via e-mail. 


Need to do something with Forum to be able to insert xml\html  code without headache)


Qi Li commented Oct 29 '12, 1:06 p.m.
JAZZ DEVELOPER

 Hi Vladimir,


I am also struggling with this issue recently, could you please send me your example? my email address is qli1@usc.edu, thanks very much!

Qi


Vladimir Amelin commented Oct 29 '12, 4:41 p.m.

Check your mail, Qi. 


Qi Li commented Oct 31 '12, 1:50 a.m.
JAZZ DEVELOPER

 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!


Vladimir Amelin commented Oct 31 '12, 2:40 a.m.

Sorry, have no idea. 

showing 5 of 6 show 1 more comments

permanent link
Lynda Eldo (11) | answered Mar 20 '15, 2:15 a.m.

Check this one, a simple ... Popup Window  sample

Lynda

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.