Crystal Reports - How can I add a dynamic hyperlink straight to Web Access from a report?

Version 2

    Environment: Crystal XI linking to Service Desk 7.4

     

    Here I'm going to run through an example of how you could design your Crystal reports so that people viewing them will be able to click on a link to take them straight to the record that they are looking at on the report in Web Access.  I hope that you may find this useful.

     

    My example will show a problem id that people can click on in order to go straight to that problem record in Web Access.  Obviously similar steps could be used to bring you to straight other records such as for example raise user details, configuration items, etc..

     

     

    7.JPG

     

    1.  First of all we need to check the form of the URL that we need Crystal to construct.  To do this, login to Web Access as usual and open up the record that you want to have a hyperlink to in your record.  So in my example I would open up a Problem in Web Access and copy the URL which would be of the form:

     

    http://<server name>/<web access virtual directory>/wd/object/open.rails?class_name=ProblemManagement.Problem&key=<unique guid of object>

     

    2.  In Crystal, using the field explorer, drag in the field that you want to be displayed for the hyperlink.  In my example, I want the problem id field to display and then this can be clicked on to hyperlink into the actual problem record in Web Access so I dragged on the problem id.

     

    3.  Right-click on this field and select Format Field.

     

    4.  On the Hyperlink tab click on the "A Website on the Internet" option.

     

     

    3.JPG

     

    5.  If we wanted to just link to a static web address (for example your intranet) you could just type this here but as we want the URL to dynamically fill in the guid for the problem record we want to open we need to click on the formula button:

     

    6.  The formula to add is of the form:

    "http://<server name>/<web access virtual directory>/wd/object/open.rails?class_name=ProblemManagement.Problem&key="+{pm_process.pm_guid}

     

    for example:

    "http://servicedesk_prod/webaccess/wd/object/open.rails?class_name=ProblemManagement.Problem&key="+{pm_process.pm_guid}

     

    8.JPG

     

     

    7.  In my example I also wanted to ensure that people viewing the report knew that they could hyperlink from this field so I formatted the problem id field to blue and underlined i.e. problemid

     

    Please note:

     

    • If your users are usually prompted to login to web access they will still need to login in order to view the record details.  Users who use integrated login will not need to login.
    • The hyperlink seems to also work if you export your reports or distribute your reports automatically via Crystal Report Server too (although I have only tested this with exporting to .pdf.)
    • Oracle Users:  You will need to convert the Oracle guid into a format which Web Access will accept.  This can be done by creating a formula using the format below (replace the CM_CHANGE.PM_GUID with the name of the Guid to convert) and then dragging the formula rather than the original guid field into the hyperlink formula:

     

    (mid({CM_CHANGE.PM_GUID},7,2)
    +mid({CM_CHANGE.PM_GUID},5,2)
    +mid({CM_CHANGE.PM_GUID},3,2)
    +mid({CM_CHANGE.PM_GUID},1,2)
    +'-'
    +mid({CM_CHANGE.PM_GUID},11,2)
    +mid({CM_CHANGE.PM_GUID},9,2)
    +'-'
    +mid({CM_CHANGE.PM_GUID},15,2)
    +mid({CM_CHANGE.PM_GUID},13,2)
    +'-'
    +mid({CM_CHANGE.PM_GUID},17,2)
    +mid({CM_CHANGE.PM_GUID},19,2)+'-'
    +mid({CM_CHANGE.PM_GUID},21,2)
    +mid({CM_CHANGE.PM_GUID},23,2)
    +mid({CM_CHANGE.PM_GUID},25,2)
    +mid({CM_CHANGE.PM_GUID},27,2)
    +mid({CM_CHANGE.PM_GUID},29,2)
    +mid({CM_CHANGE.PM_GUID},31,2))