Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Howto get the SERVER_URL within a Birt report?

I would like to display the Server URL within a Birt report.
Following statement is returning me just "null".

reportContext.getAppContext().get("SERVER_URL")

Any idea what I'm missing or what I have not correctly configured on the server, so BIRT would know the Server URL?

0 votes

Comments

Has somebody successfully implement this in BIRT?


Accepted answer

Permanent link
reportContext.getAppContext().get ("SERVER_URL") will only return non null if it is necessary; i.e., a report is being displayed with data coming from a different server.

So 99 % of the time, you should use a relative URL.


Guido Schneider selected this answer as the correct answer

0 votes

Comments

Hi Rafik, thank you for the info. Now it make sense. Actually everything works fine in my case because I force ServerURL to "" in case of Null , and Guido probably not,

In our case I we can probably just use "/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/"

erwin


One other answer

Permanent link
 I use following code in the hyperlink of a field

var serverURL = reportContext.getAppContext().get ("SERVER_URL"); 
if (serverURL == null) serverURL = ""; 
serverURL + "/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/"+row["WI_ID"]

1 vote

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,117

Question asked: Jul 01 '12, 1:15 p.m.

Question was seen: 9,591 times

Last updated: Oct 02 '12, 2:09 a.m.

Related questions
Confirmation Cancel Confirm