Hyperlinking a lookup column's values in a SharePoint 2007 DataFormWebPart in SharePoint Designer

Mar 13, 2015 at 3:30 PM
I have a DataFormWebPart in SharePoint Designer 2007. It's made up of a Title column and three other lookup columns. The lookup columns just display text values. How do I hyperlink the lookup values? The lookup columns are @Schema, @Database, @Host and @System in the code below. Do I have to use SPServices? Please help!
<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="0" Title="Columns" ListName="{7D9CF507-986C-49BA-B882-BCE1860C8469}" Default="FALSE" DisplayName="Columns" __markuptype="vsattributemarkup" __WebPartId="{9BEBEC48-DE10-4290-A19C-1136521C3000}" id="g_9bebec48_de10_4290_a19c_1136521c3000" __AllowXSLTEditing="true" WebPart="true" Height="" Width="">
    <DataSources>
        <SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef LookupId='TRUE' Name=&quot;RelatedTerm&quot;/&gt;&lt;Value Type=&quot;LookupMulti&quot;&gt;{MY_TermX_ID}&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;" id="Columns1"><SelectParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="7D9CF507-986C-49BA-B882-BCE1860C8469"/><WebPartPages:DataFormParameter Name="MY_TermX_ID" ParameterKey="MY_TermX_ID" PropertyName="ParameterValues" DefaultValue="2055"/></SelectParameters><DeleteParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="7D9CF507-986C-49BA-B882-BCE1860C8469"/></DeleteParameters><UpdateParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="7D9CF507-986C-49BA-B882-BCE1860C8469"/></UpdateParameters><InsertParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="7D9CF507-986C-49BA-B882-BCE1860C8469"/></InsertParameters></SharePoint:SPDataSource>
    </DataSources>
    <ParameterBindings>
    <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
    <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
    <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
    <ParameterBinding Name="ListID" Location="None" DefaultValue="7D9CF507-986C-49BA-B882-BCE1860C8469"/>
    <ParameterBinding Name="MY_TermX_ID" Location="QueryString(ID)" DefaultValue="2055"/>
</ParameterBindings>
    <datafields>@Title,Database Column Name;@DatabaseColumnDefinition,Database Column Definition;@RelatedTerm,Related Term;@ColumnValues,Column Values;@Nullable,Nullable;@DataType,Data Type;@Length,Length;@Precision,Precision;@Scale,Scale;@System,System;@Host,Host;@Database,Database;@Schema,Schema;@DatabaseTable,Database Table;@n,Comments;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;</datafields>
    <XSL>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:decimal-format NaN=""/>
    <xsl:param name="dvt_apos">&apos;</xsl:param>
    <xsl:param name="ListID">7D9CF507-986C-49BA-B882-BCE1860C8469</xsl:param>
    <xsl:param name="MY_TermX_ID">2055</xsl:param>
    <xsl:variable name="dvt_1_automode">0</xsl:variable>
    <xsl:template match="/">
        <xsl:call-template name="dvt_1"/>
    </xsl:template>
    <xsl:template name="dvt_1">
        <xsl:variable name="dvt_StyleName">Table</xsl:variable>
        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
        <xsl:variable name="dvt_RowCount" select="count($Rows)" />
        <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
        <table border="0" width="100%" cellpadding="2" cellspacing="0">
            <tr valign="top">
                <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
                    <th class="ms-vh" width="1%" nowrap="nowrap"></th>
                </xsl:if>
                <th class="ms-vh" nowrap="nowrap">Database Column Name</th>
                <th class="ms-vh" nowrap="nowrap">Database Table</th>
                <th class="ms-vh" nowrap="nowrap">Schema</th><th class="ms-vh" nowrap="nowrap">Database</th><th class="ms-vh" nowrap="nowrap">System</th></tr>
            <xsl:call-template name="dvt_1.body">
                <xsl:with-param name="Rows" select="$Rows"/>
                </xsl:call-template>
        </table>
        </xsl:template>
    <xsl:template name="dvt_1.body">
        <xsl:param name="Rows"/>
        <xsl:for-each select="$Rows">
                    <xsl:call-template name="dvt_1.rowview" /></xsl:for-each>
    </xsl:template>
    <xsl:template name="dvt_1.rowview">
        <tr>
            <xsl:if test="position() mod 2 = 1">
                <xsl:attribute name="class">ms-alternating</xsl:attribute>
            </xsl:if>
            <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
                <td class="ms-vb" width="1%" nowrap="nowrap">
                    <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
                </td>
            </xsl:if>
            <td class="ms-vb">
                <a href="/sites/ITCollection/MainSite/Lists/Columns/DispForm.aspx?ID={@ID}">
                <xsl:value-of select="@Title"/>
                </a>
            </td>
            <td class="ms-vb">
                <xsl:value-of select="@DatabaseTable" /></td>
            <td class="ms-vb">
                <xsl:value-of select="@Schema" /></td><td class="ms-vb">
                <xsl:value-of select="@Database" /></td><td class="ms-vb">
                <xsl:value-of select="@System" /></td></tr>
    </xsl:template>
    </xsl:stylesheet>   </XSL>
</WebPartPages:DataFormWebPart>