Create BIRT report leveraging an existing work item query
I created an RTC 2.0 BIRT report that generates results sets across multiple projects and repos leveraging an existing query for unassigned/unresolved work items for each project. It's based upon the work of James Moody (see Jazz.net videa -- Creating a report in Rational Team Concert 2.0 - Work item query).
I like to be able to drill-down to the actual Work Item by clicking on the Work Item ID in the report, however, my attempts to do so through BIRT have failed. Any ideas/recommendations on how to generate the fully qualified Work Item URL and associate it with the Work Item ID? Thank you in advance for your responses! |
7 answers
On 7/21/2009 6:07 PM, bj wrote:
I created an RTC 2.0 BIRT report that generates results sets across Hi bj, Sorry for the delay in responding. You can indeed do drill-through. We've done this in the past using relative URLs (not fully-qualified). See our example report "Story Child Work Items.rptdesign" (in the "live" folder of our com..ibm.team.examples.reports.common plug-in). In the table, there's a field labeled "WI_ID". Click on it, then select "Hyperlink" in the Property Editor view. See the hyperlink we've created: "#action=com.ibm.team.workitem.viewWorkItem&id="+row That's the magic you need. Hope the video was helpful. james RTC Reports Team Lead |
In RTC 2.0, when I open a dashboard with links to work items, I can hover over the work item and see a popup with the basic information about the work item. Is there a way to do that to the links in a BIRT report? The link syntax that you mention above works, but shows no popup.
I looked at the source, and the link in the dashboard that gets the popup looks like this: <a widgetid="jazz_app_ResourceLink_46" id="jazz_app_ResourceLink_46" class="jazz-app-ResourceLink" href="https://[servername]:[portnumber]/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/[workitemnumber]">[workitemnumber]: [summarytext] <img src="/jazz/web/jazz.app/internal/images/ResourceLink/rh-twistie.gif" class="arrow"></a> I changed my links in the report to match, but I still don't see the popups. Do I need to enable some javascript file from the report page? |
On 8/12/2009 2:23 PM, tmcmack wrote:
In RTC 2.0, when I open a dashboard with links to work items, I can So I haven't actually done this myself, but... if you could get the title attribute set on this a tag, it would provide tooltip help. But the anchor is auto-generated by BIRT, and I don't immediately see any way to set the title tag. No worries, you can also do this dynamically. If you create a fragment of (client-side) javascript somewhere in the report underneath this anchor (i.e. later in the document), you can set it yourself. Hopefully this renders okay: <code> <script> document.getElementById("jazz_app_ResourceLink_46").title="Some tooltip" </script> </code> Although you can see the id is pretty ugly and not predictable. That's okay, you can tell BIRT what ID to use by setting the "bookmark" attribute on the BIRT element. It'll use the id that you specify instead of a randomly-generated one, and then you can reference that from your javascript. Hope this helps, let me know how it goes. james RTC Reports Team Lead |
Thanks, James -- that method works to add textual popups. Is there any code I can add to show information about the work items? On dashboards in RTC 2.0, when I hover over a work item in a list, I see a popup that provides details about the work item. That would be very convenient to have in my reports.
Is there some code I can add to call the javascript that shows this popup? Thanks! On 8/12/2009 2:23 PM, tmcmack wrote: |
I don't have sample code for it, but you can put whatever javascript
code you want in there. So if you write code that (for example) creates a popup div (or whatever) and populates it with whatever information you want, you should be able to insert this to customize the behaviour of the report. Note this only works for HTML output (of course) and you should hide this element for other output types (PDF, etc.), which you can do on the Visibility tab for the element. james RTC Reports Team Lead On 8/26/2009 10:08 AM, tmcmack wrote: Thanks, James -- that method works to add textual popups. Is there any |
Ok, it turns out to be fairly simple to add a popup to a link. Here's the code for anyone who may be interested. I'm still trying to work out the authentication (because the popup shows a message about logging in at the top of the window), but it shows all the important information anyway.
For more information on that popup, see this wiki page: ResourceLink. I don't have sample code for it, but you can put whatever javascript |
Thanks for sharing this. I've added a section to our report writing FAQ
describing this solution. https://jazz.net/wiki/bin/view/Main/ReportsBIRTFAQ james RTC Reports Team Lead On 8/27/2009 9:53 AM, tmcmack wrote: Ok, it turns out to be fairly simple to add a popup to a link. Here's |
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.