Adding custom columns to the rollupdataform

Jul 21, 2009 at 6:27 PM
Edited Jul 21, 2009 at 6:29 PM

I'm trying to reference a custom field in the DataFields element of the rollupdataform like the following:

<DataFields>@_ListId,_ListId;@_WebId,_WebId;@_ItemId,_ItemId;@Title,Title;@Major_x0020_Service_x0020_Catego,Major;</DataFields>

the last field is my custom field and it's a lookup.  I verified that the internal name is correct @Major_x0020_Service_x0020_Catego and I'm expecting that I should see this additional field show up in the Data Source Details tab of the toolbox.  It doesn't.  If I Refresh the data source my additional field goest away.

you can recreate this my adding a list to your site, then referenceing the list using a custom column of type lookup pointing to that list called Major Service Category.
I'm attempting to include this column in the dataset by adding it to fields element of the datasource:
<Fields><FieldRef Name="Title" /><FieldRef Name="@Major_x0020_Service_x0020_Catego" /></Fields>

but when i do (or try @Major) the data source details tab on the toolbox shows the empty dataset.
I must be doing something wrong in my mappings of this new column.I've tried this in and out of a web part zone.
I have included the entire control source below:
<WebParts:RollUpDataFormWebPart runat="server" ShowWithSampleData="False" AllowRemove="True" AllowHide="True" SuppressWebPartChrome="False" PartImageLarge="" ViewContentTypeId="" ID="g_c6589fbf_e9d3_498e_b13f_603c28d2d706" ExportMode="All" Debug="False" Dir="Default" MissingAssembly="Cannot import this Web Part." FixSorting="True" IsIncludedFilter="" DetailLink="" AllowEdit="True" UseSQLDataSourcePaging="True" HelpMode="Modeless" IsIncluded="True" Description="Use to display dynamic content views from a collection of sites. The results are displayed in the Data Form Web Part." NoDefaultStyle="" FrameState="Normal" AllowConnect="True" AllowZoneChange="True" AllowMinimize="True" Title="Major Service Categories" PartOrder="1" PageSize="-1" FrameType="Default" HelpLink="" PartImageSmall="" ExportControlledProperties="True" IsVisible="True" __MarkupType="vsattributemarkup" __WebPartId="{C6589FBF-E9D3-498E-B13F-603C28D2D706}" __AllowXSLTEditing="true" WebPart="true" Height="" Width="">
<DataFields>@_ListId,_ListId;@_WebId,_WebId;@_ItemId,_ItemId;@Title,Title;@Major_x0020_Service_x0020_Catego,Major;</DataFields>
<ParameterBindings>
 <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
 <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
 <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
 <ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_adhocmode" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_adhocfiltermode" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_filterfield" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_filtertype" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_filterval" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_groupdir" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_groupdisplay" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_groupfield" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_groupsorttype" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_grouptype" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/>
 <ParameterBinding Name="dvt_sorttype" Location="Postback;Connection"/>
</ParameterBindings>
<DataSources>
<WebParts:AggregateDataSource runat="server" ID="aggDSC"><Aggregate><union><datasource id="DSC1" /><datasource id="DSC2" /></union></Aggregate><Sources><WebParts:CrossSiteDataSource runat="server" ContentType="Service Item" TopLevelSite="/" Scope="Recursive" Lists="100" DatesInISO8601="True" FixLookups="True" QueryRowLimit="100" ID="DSC1"><Fields><FieldRef Name="Title" /><FieldRef Name="@Major_x0020_Service_x0020_Catego" /></Fields><Query></Query>
</WebParts:CrossSiteDataSource><WebParts:CrossSiteDataSource runat="server" ContentType="Service Page" TopLevelSite="/" Scope="Recursive" Lists="850" DatesInISO8601="True" FixLookups="True" QueryRowLimit="100" ID="DSC2">
<Fields><FieldRef Name="Title" /><FieldRef Name="@Major_x0020_Service_x0020_Catego" /></Fields>
<Query></Query>
</WebParts:CrossSiteDataSource>
</Sources></WebParts:AggregateDataSource>
</DataSources>
<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:param name="dvt_apos">'</xsl:param>
 <xsl:variable name="dvt_1_automode">0</xsl:variable>
 <xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
 <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/NewDataSet/Row"/>
 <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="">Title</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" ddwrt:cf_ignore="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">
 <xsl:value-of select="@Title"/>
 <xsl:value-of select="@Major_x0020_Service_x0020_Catego"/>
 </td>
 </tr>
 </xsl:template>
</xsl:stylesheet></Xsl>
</WebParts:RollUpDataFormWebPart>



Apr 21, 2010 at 8:25 PM
Edited Apr 21, 2010 at 8:40 PM

   Is there a solution to this problem? We are not able to use columns with spaces in the data source. It does not retrieve data even if we give the correct internal name with _x0020_ for the spaces. I checked the internal names by writing a console app to get the internal names. Appreciate any help.

Thanks,