It's all about the answers!

Ask a question

Hyperlinks do not work when a Birt report is exported into Excel, PDF, ...

Hansruedi Ehrenberg (2558) | asked Dec 21 '12, 7:39 a.m.

Hello all

I have created a report with BIRT for RTC V 4.0.1.

The report shows a list of workitems. The column Work ID is linked through a hyperlink to the workitem.
The code for creating the url is:
var serverURL = reportContext.getAppContext().get("SERVER_URL");
if (serverURL == null) serverURL = "";
workitem.url = serverURL +

When I run this report in RTC the work item opens successfully when I select the link.

When I export this report from RTC into Excel, PDF, Word or ... the links do not open the work item.

May I ask someone to help me to resolve this issue. Thanks in advance.



Alanna Zito commented Jan 02 '13, 9:36 a.m.

Can you be more specific about what happens when you click on the link from the exported report?  Do you get an error, or is the link itself incorrect?

Hansruedi Ehrenberg commented Jan 04 '13, 1:29 a.m.

When I run the report in RTC a correct link is e.g.

The mouse over on the same link in the Excel exported report shows the following link file:///C:\Users\EhrenbeH\AppData\Local\Microsoft\Temporary Internet Files\Content.IE5\IEYMS708\Report[1]xls - auto_generated_bookmark1.
When I click this link I get the error 'Reference is not valid.

I hope you can help me to resolve this issue. Thank you in advance.

Millard Ellingsworth commented Jan 04 '13, 1:49 p.m.

Does the code you showed above put a hard link into the report (which should export correctly) or dynamically calculate the link? If it is dynamically calculated, it is unlikely that the "export to X" process exports the code for making the link (and there's a chance that code couldn't execute successfully in the exported environment anyway). For this to work, the exported link needs to be the same as the link in the report. Is it possible to re-work the report implementation so that the link is exportable? 

Hansruedi Ehrenberg commented Jan 15 '13, 9:26 a.m. | edited Jan 15 '13, 9:27 a.m.

Hello Millard
this is exactly my question: how do I have to implement the code for the link that the link will be the same in the exported report as it is in the RTC report. Can you help me?
Do you have an example?

Rafik Jaouani commented Jan 15 '13, 1:52 p.m.

Can you please open a defect in RTC and attach a sample report that duplicates the problem?

Hansruedi Ehrenberg commented Jan 16 '13, 8:47 a.m.

Sorry, may I ask you for the link that I can open a defect in RTC?

Alanna Zito commented Jan 16 '13, 9:06 a.m.

You can log a defect against Jazz Foundation here: Foundation

Hansruedi Ehrenberg commented Jan 17 '13, 8:49 a.m.

Hello Rafik

I can not create a defect in RTC and attach the sample report. I got a permission denied error. Does it give another way to send you the report example?

Hansruedi Ehrenberg commented Jan 18 '13, 8:43 a.m.

Hello Rafik I have created the Defect 247880 in RTC and have attached the example report design. Thanks in advance for your help.

showing 5 of 9 show 4 more comments

Accepted answer

permanent link
Rafik Jaouani (5.0k16) | answered Jan 18 '13, 9:53 a.m.
Hansruedi, Thanks for sending me the report design. Here is what is happening:
The URLs your report are generating are relative. You can find that out by making the report output the value: row["url"].
I can probably guess your next question: But you are prefixing the URL with: reportContext.getAppContext().get("SERVER_URL")
The above call will always return null unless someone is trying to display a report or a report viewlet that is coming from a different jazz server. So our reports always try to use relative URLs unless it is necessary to use full URLs.

So you cannot trust reportContext.getAppContext().get("SERVER_URL") to give you the server URL.

I will change your defect into an enhancement request and start passing another variable: FULL_SERVER_URL that is guaranteed to always contain the server URL.

Until then, you will need to hard code the server URL in your report or pass it as a parameter.
Hansruedi Ehrenberg selected this answer as the correct answer

One other answer

permanent link
Rafik Jaouani (5.0k16) | answered Jan 11 '13, 10:19 a.m.
 Notice also that the format of the link could be different depending on the output format, by using the visibility property of the reporting artefact that computes the link. 

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.