Hyperlinks do not work when a Birt report is exported into Excel, PDF, ...
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 + "#action=com.ibm.team.workitem.viewWorkItem&id="+row["WI_ID"]
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.
Regards,
Hansruedi
Accepted answer
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.
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.
Comments
Alanna Zito
JAZZ DEVELOPER Jan 02 '13, 9:36 a.m.Hansruedi Ehrenberg
Jan 04 '13, 1:29 a.m.Millard Ellingsworth
FORUM ADMINISTRATOR / JAZZ DEVELOPER Jan 04 '13, 1:49 p.m.Hansruedi Ehrenberg
Jan 15 '13, 9:27 a.m.Rafik Jaouani
JAZZ DEVELOPER Jan 15 '13, 1:52 p.m.Hansruedi Ehrenberg
Jan 16 '13, 8:47 a.m.Alanna Zito
JAZZ DEVELOPER Jan 16 '13, 9:06 a.m.Hansruedi Ehrenberg
Jan 17 '13, 8:49 a.m.Hansruedi Ehrenberg
Jan 18 '13, 8:43 a.m.