SSRS Recurrence Items from Calender List Sharepoint - The SharePoint list query is not valid: The XML element QueryOptions in the query is not valid

我是研究僧i 提交于 2019-12-13 03:28:15

问题


I am trying to grab all items in the next upcoming week from a sharepoint list, some of these may be recurring items that have been created a few months back. I am getting the below error:

The SharePoint list query is not valid: The XML element QueryOptions in the query is not valid.

This is my sharepoint query designer code in SSRS:

<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ListName>Change Control</ListName>
 <Query>
 <Where>
  <DateRangesOverlap>
  <FieldRef Name='EventDate' />
  <FieldRef Name='EndDate' />
  <FieldRef Name='RecurrenceID' />
  </DateRangesOverlap>
 </Where>
 </Query>
<QueryOptions>
 <ExpandRecurrence>TRUE</ExpandRecurrence>
 <ViewAttributes Scope='RecursiveAll' />
 </QueryOptions>
  <ViewFields>
    <FieldRef Name="Title" />
    <FieldRef Name="Originators_x0020_Name" />
    <FieldRef Name="EventDate" />
    <FieldRef Name="EndDate" />
    <FieldRef Name="ID" />
    <FieldRef Name="RecurrenceID" />
    <FieldRef Name="RecurrenceData" />
    <FieldRef Name="Staff_x0020_Involved_x0020_with_" />
  </ViewFields>
</RSSharePointList>

回答1:


What you've posted is indeed a valid CAML query but it's clear the SharePoint List Query in SSRS does not support the full range of CAML (reference).

Instead you should setup an "XML Data Source" inside SSRS and hook that up to a SharePoint web service that does support the full range of CAML queries.

Summary of steps:

  1. Open report builder
  2. Right click the “Data Sources” folder and select “Add Data Source”
  3. Enter “XMLTest” as the data source name
  4. Select “Use a connection embedded in my report”
  5. Select “XML” as the “Connection Type”
  6. For the connection string you’ll want to enter the URL to your site plus “/_vti_bin/lists.asmx”. (You can verify the connection string by entering it into your web browser. Doing so should return a list of web services for the site.)
  7. Click on the “Credentials” menu item on the left hand side of the “Data Source Properties” window
  8. Select the option “Use the current Windows user. Kerberos delegation might be required.”
  9. Click the “OK” button on the “Data Source Properties” window.

Source: http://tavislovell.com/using-ssrs-with-sharepoint-library-folders/



来源:https://stackoverflow.com/questions/44904429/ssrs-recurrence-items-from-calender-list-sharepoint-the-sharepoint-list-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!