If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

script or function to identify host name for use in cognos variable?

Started by jriley, 04 May 2010 12:04:08 PM

Previous topic - Next topic

jriley

Good Afternoon,

We use hyperlinks in our reports to pass parameters via URL to a linked application to open a detail view for a particular row item.  The URL is hard-coded to a particular environment (i.e. 'http://dev.domain.loc/reports/getid.aspx?id=' || [SQL1].[p_ID]') and the paramater is passed in name-value pair as follows:  ?p_id=190943. 

So regarding, the hard-coded portion of this URL string, is there a script or function we can pass in the local hostname to the URL based on the environment from which the report is launched? 

If we are in the DEV environment,  http://dev.domain.loc, can we programmatically grab this portion of the URL and use it to build out our hyperlink?

The issue we've had is that some of these reports have been moved into PROD with the hyperlink pointing to our DEV or TEST environment and therefore do not work.  We're looking for a way to get away from hard-coding these links to avoid this problem.

Thanks,
Joe

jriley

In reviewing again, we had come across something.  We created a report expression.  (dropped a text item onto the report and changed the Source Type on properties from Text Item to Report Expression.)  We edited the item and within Report Functions, we found ServerName property.  ServerName() returns the name of the server that runs the report.

It does return the dev.domain.loc value which we can use to build out our URL string.

Hope this might help somebody else.  Looks to be lots of Report functions available there for perusal.

Thanks,
Joe