views:

674

answers:

1

I'm using SQL Server 2008 with Report Builder 2.0 to try and query data from a Sharepoint List, as described in this tutorial. The report is set up to use an XML data source with the connection string set to http://mySharepointSite/_vti_bin/lists.asmx.

However, I cannot seem to get all the fields from the Sharepoint List, even if I specify a view that contains specifically the fields I want and no more. Depending on how I manipulate the query, I seem to get either the Release field or the Theme field, but not both at the same time. Here's my query as it is right now:

<Query><SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems&lt;/SoapAction&gt;
   <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
      <Parameters>
         <Parameter Name="listName">
            <DefaultValue>{8529D70B-D632-4CC8-A1E7-2C25F29BE1E0}</DefaultValue>
         </Parameter>
         <Parameter Name="viewName">
            <DefaultValue>{2FC6AA42-EA95-4C18-AB07-33E25EBBA85D}</DefaultValue>
            <ViewFields>
               <FieldRef Name="Resolve_x0020__x0023_" />
               <FieldRef Name="Product" />
               <FieldRef Name="Release" />
               <FieldRef Name="Theme" />
               <FieldRef Name="Pre_x002d_Req_x0020_Estimate" />
            </ViewFields>
         </Parameter>
      </Parameters>
   </Method>
   <ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>

When I tested using Report Builder 3.0 with its built-in Sharepoint List data source type, it was able to see both the Theme and Release fields in my List. Does anyone know what's going on with Report Builder 2.0, though, when I don't get all the fields in the given List and view?

Update: In response to nelsonwebs' questions:

  1. "Does the list contain an InfoPath form?" I... don't know? It looks to just contain textual data.
  2. "How is the list data being input to the columns?" I'm not sure what you're asking. The data in Sharepoint is entered by other people and I suppose they just use the usual Sharepoint means (adding a new item to the List).
  3. "Have you customized the list such as adding/adjusting the content types?" It's a List that has been around on our Sharepoint site for a while, and it's been customized in that it has field types like Number, Multiple lines of text, and Choice, but I think those are just default Sharepoint types.
A: 

Jin Chen over on Microsoft Forums found a solution for me. Apparently, when a field has a null value, even if that field is in the view you want, it won't return the field. The trick is to explicitly list the fields you want in the ElementPath tag:

<ElementPath IgnoreNamespaces="true">
    GetListItemsResponse/GetListItemsResult/listitems/data/row{@field1,@field2,@field3,@field4}
</ElementPath>
Sarah Vessels