1

I have this XML query that pulls all entries and fields from a SharePoint list.

    <Query>
   <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
   <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
      <Parameters>
         <Parameter Name="listName">
            <DefaultValue>{XXXX-8857-4094-8F1E-F2F21E6BC596}</DefaultValue>
         </Parameter>
      </Parameters>
   </Method>
   <ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>

But if I attempt to add where clause as follows I get XMLDP query is invalid

 <Query>
   <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
   <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
      <Parameters>
         <Parameter Name="listName">
            <DefaultValue>{XXXXX-8857-4094-8F1E-F2F21E6BC596}</DefaultValue>
         </Parameter>
<Parameter Name="query" Type="xml"'>
<DefaultValue>
  <Query>
    <Where>
      <Eq>
        <FieldRef Name="Title"/>
        <Value Type="Text">Cigna</Value>
      </Eq>
    </Where>
  </Query>
</DefaultValue>
</Parameter>
      </Parameters>
   </Method>
   <ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>

Also, as I build the report, I attempt to format sharepoint Dates from 2013-04-11 01:01:01 to 4/11/2013 with no luck using properties format or =format

UPDATE: I'm also asking on MSDN: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/9039dcdf-12ab-4401-8142-0f91d41ec6ca

  • If you want to do this ever use office and a copy of fiddler to record the transport. You can see how the XML works for office when getting list items or even retrieving a document properties or upload/download documents. – Hugh Wood Apr 23 '13 at 17:43
0

Found it. Query has to be in a parameter and must be called query.

My Dataset Query looks this:

    <Query>
   <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
   <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
      <Parameters>
         <Parameter Name="listName">
            <DefaultValue>{2C2C18D5-8857-4094-8F1E-F2F21E6BC596}</DefaultValue>
         </Parameter>
        <Parameter Name="query" Type="xml">
        </Parameter>
      </Parameters>
   </Method>
   <ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>

My Parameter looks like this:

<Query><Where><Eq><FieldRef Name="Title"/><Value Type="Text">Cigna</Value></Eq></Where></Query>
  • No = or quote encapsulated.
  • it matters that the parameter be called query.
  • Title does not have ows_ prefix

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.