Request Sharepoint 2007 list from SSRS 2005 - sharepoint

as the title says i'm trying get some list items from my sharepoint website into my SSRS 2005 report. I tryed to folow and adapt some tutorials for SSRS 2008 like this one :
http://nikspatel.wordpress.com/2010/04/30/step-by-step-consuming-sharepoint-lists-data-in-the-ssrs-reports/
The thing is that I get stuck int the 6th step when I try to validate my query. I tryed to pass some queries that i post below:
<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>EraDemandes</DefaultValue>
</Parameter>
<Parameter Name='rowLimit'>
<DefaultValue>100</DefaultValue>
</Parameter>
<Parameter Name='query' Type='xml'>
<DefaultValue>
<Query>
<Where>
<Eq>
<FieldRef Name='ID'/>
<Value Type='Integer'>1016</Value>
</Eq>
</Where>
</Query>
</DefaultValue>
</Parameter>
<Parameter Name='viewFields' Type='xml'>
<DefaultValue>
<ViewFields>
<FieldRef Name='Title' />
<FieldRef Name='ID' />
</ViewFields>
</DefaultValue>
</Parameter>
<Parameter Name='queryOptions' Type='xml'>
<DefaultValue>
<QueryOptions>
<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
<DateInUtc>TRUE</DateInUtc>
</QueryOptions>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces='True'>*</ElementPath>
</Query>
<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>Liste des Demandes</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
I tryed to remove / modify all the parameters without succes. I'm realy not familiar with SSRS so plz go on and ask every question you need.
I have few question myself:
On the 2 queries i used 2 differents name for the list: "EraDemandes" is the name I got in my URL when i'm accessing my list through sharepoint and "Liste des Demandes" is the name of the list in Sharepoint. I beleive that in sharepoint there is 2 name, a display name and a sharepoint name. Which one should i use ?
My root Sharepoint Site collection is 'http://m-epderaqua/default.aspx' and the list I want to casses are on all the subsites from this collection (http://m-epderaqua/ERA73/default.aspx or http://m-epderaqua/ERA38/default.aspx). Which web address should I use in my datasource ? Should i use many datasource (like one for each subsites) ?
Help plz.

I can't tell why but it's just working perfectly fine right now. I suppose the maintenance team did somthing during the week-end but I don't know what...

Related

SharePoint Recurring Events Are Random?

Note: This question is similar to an existing, unanswered question (CAML OrderBy for SharePoint Recurring Calendar Event).
How can I use the Lists.asmx web service to retrieve recurring events that occur today or later?
I am providing the <CalendarDate>2019-06-25T15:55:04.108Z</CalendarDate> parameter when sending the request to the /_vti_bin/Lists.asmx web service, yet I'm still receiving events from the past (as shown in the screenshot below)!
This is the XML response (screenshot). Notice how the event dates are before today even though "CalendarDate" is specified as "2019-06-25":
This is the XML payload sent with the request:
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Body>
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
<listName>{ my list GUID }</listName>
<query>
<Query>
<OrderBy>
<FieldRef Ascending='TRUE' Name='EventDate' />
</OrderBy>
<Where>
<And>
<Eq>
<FieldRef Name="fRecurrence" />
<Value Type="Boolean">1</Value>
</Eq>
<DateRangesOverlap>
<FieldRef Name="EventDate" />
<FieldRef Name="EndDate" />
<FieldRef Name="RecurrenceID" />
<Value Type='DateTime'>
<Year/>
</Value>
</DateRangesOverlap>
</And>
</Where>
</Query>
</query>
<viewFields>
<ViewFields>
<FieldRef Name="Category" />
<FieldRef Name="Location" />
</ViewFields>
</viewFields>
<queryOptions>
<QueryOptions>
<ViewAttributes Scope="RecursiveAll" />
<RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>
<DateInUtc>TRUE</DateInUtc>
<ExpandRecurrence>TRUE</ExpandRecurrence>
<CalendarDate>2019-06-25T15:55:04.108Z</CalendarDate>
<RecurrenceOrderBy>TRUE</RecurrenceOrderBy>
</QueryOptions>
</queryOptions>
<rowLimit>20</rowLimit>
</GetListItems>
</soap:Body>
</soap:Envelope>
Edit: The following is an example of an event that is not being returned by the query above.
Year does not honour the CalendarDate property - it returns previous events that happened within a year from current date and future events a year from current date.
Use <Value Type='DateTime'><Now /></Value> in the DateRangesOverlap and remove the CalendarDate to retrieve recurring events that occur today or later

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 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>
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:
Open report builder
Right click the “Data Sources” folder and select “Add Data Source”
Enter “XMLTest” as the data source name
Select “Use a connection embedded in my report”
Select “XML” as the “Connection Type”
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.)
Click on the “Credentials” menu item on the left hand side of the “Data Source Properties” window
Select the option “Use the current Windows user. Kerberos delegation might be required.”
Click the “OK” button on the “Data Source Properties” window.
Source: http://tavislovell.com/using-ssrs-with-sharepoint-library-folders/

SharePoint 2013 Columns Sorting Order

I am quite new in Sharepoint. I am working on sharepoint 2013. I have created a content type with Visual Studio.
I have written a query to sort the columns.
<OrderBy>
<FieldRef Name='Order' Ascending='True' />
<FieldRef Name='SortingOrder' Ascending='False' />
<FieldRef Name='IsFeatured1' Ascending='False' />
<FieldRef Name='Created' Ascending='False' />
</OrderBy>";
I just want to know which column will execute first. I am quite unable to understand the flow.
I want order something like that..
IsFreatured1
SortingOrder
Order
Created
The order in which the fields appear in the <OrderBy> node, is the order in which they are sorted.
So, to get the requirement you specified in your question, you have to use this OrderBy statement:
<OrderBy>
<FieldRef Name='IsFeatured1' Ascending='False' />
<FieldRef Name='SortingOrder' Ascending='False' />
<FieldRef Name='Order' Ascending='True' />
<FieldRef Name='Created' Ascending='False' />
</OrderBy>
https://msdn.microsoft.com/en-us/library/office/ms467378.aspx

Reporting Services, get data from any Sharepoint List

I am trying to build an SSRS (2008R2) report based on a Sharepoint (2010) List.
The main problem is that the List on which the report will run has to be a report parameter.I know what the list structure will be, but the sharepoint site can contain several list instances having this structure, and when running the report, the user has to choose the List Name.
Also, the report has two date parameters, MinDateTime and MaxDateTime, and selects only the records with times between these two.
From what I can tell, there are at least two approaches to building the report:
Use a Sharepoint List Data Source and write the Dataset query in CAML, specify the site in the DataSource, let SSRS handle the rest of the details. The problem in this case is that I can't specify the ListName as a report parameter. The DataSet query looks like this:
<pre>
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>BusinessList1</ListName>
<ViewFields>
<FieldRef Name="Title" />
<FieldRef Name="BusinessUnit" />
<FieldRef Name="ScanDateTime" />
</ViewFields>
<Query>
<Where>
<And>
<Geq>
<FieldRef Name="ScanDateTime" />
<Value Type="DateTime">
<Parameter Name="MinScanDateTime" />
</Value>
</Geq>
<Leq>
<FieldRef Name="ScanDateTime" />
<Value Type="DateTime">
<Parameter Name="MaxScanDateTime" />
</Value>
</Leq>
</And>
</Where>
</Query>
</RSSharePointList>
Use an XML Data Source and write the Dataset query in soap-readable XML, access the /_vti_bin/lists.asmx webservice directly. The query should look something like this (including the list name as a parameter). However, I couldn't make it work at all with the Date parameters. Where should they be added?
<pre>
<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>BusinessList1</DefaultValue>
</Parameter>
<Parameter Name="viewFields">
<ViewFields>
<FieldRef Name="Title" />
<FieldRef Name="BusinessUnit" />
<FieldRef Name="ScanDateTime" />
</ViewFields>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
Any direction would be great.
Thanks,
You can use option 1, writing the query as an expression. Build up a long string with the parameter in the middle. You need a separate query to supply the list of BusinessLists to the parameter.
Expression would look like this:
="<pre>
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>"
& Parameters!BusinessList.value &
"</ListName>
<ViewFields>
<FieldRef Name="Title" />
<FieldRef Name="BusinessUnit" />
<FieldRef Name="ScanDateTime" />
</ViewFields>
<Query>
<Where>
<And>
<Geq>
<FieldRef Name="ScanDateTime" />
<Value Type="DateTime">
<Parameter Name="MinScanDateTime" />
</Value>
</Geq>
<Leq>
<FieldRef Name="ScanDateTime" />
<Value Type="DateTime">
<Parameter Name="MaxScanDateTime" />
</Value>
</Leq>
</And>
</Where>
</Query>
</RSSharePointList>"
[EDIT]:
I'm not sure where the pre tag came from either. I've run through creating a test report using the sharepoint list connection type and it doesn't add that. Check out this MS link on the basics.
It points out that you don't need to specify the fields to return, so a very basic query expression looks like this (with my stuffed parameter added):
="<RSSharePointList xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><ListName>" & Parameters!List.Value & "</ListName></RSSharePointList>"
In my original example above I failed to mention that you need to escape the double quotes within the XML by doubling them up. I've tested this and it works well.

Unable to retrieve files from a SharePoint library with spaces in it via SSRS and an XML Datasource

I'm trying to retrieve files from sharepoint via SSRS and an XML Datasource.
This is what I'm currently using:
<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>account</DefaultValue>
</Parameter>
<Parameter Name="queryOptions" Type="xml">
<DefaultValue>
<QueryOptions>
<Folder>account/testfolder</Folder>
</QueryOptions>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>
I can retrieve all of the files from the testfolder located under account (that's good!) however. If I create a query like 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>Invoice City</DefaultValue>
</Parameter>
<Parameter Name="queryOptions" Type="xml">
<DefaultValue>
<QueryOptions>
<Folder>Invoice City/testfolder</Folder>
</QueryOptions>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>
The second that I add the space in the library name (Invoice City) it just returned everything in the Invoice City library (folders and files).
I would just make the folder name without spaces but I'm using CRM Documents and it auto creates folders as the entity name (Invoice City).
I've tried putting the folder name in quotes, and a billion other tries of escape characters and other things. I would expect this to work as the web service is just expecting a string.
Has anyone else ran into this issue? Help is greatly appreciated.
Figured out the problem! It didn't have anything to do with spaces in the end (though I thought it might have been).
I was using the library name instead of the path name.. So for the fix:
<Parameter Name="queryOptions" Type="xml">
<DefaultValue>
<QueryOptions>
<Folder>**new_invoicecity**/testfolder</Folder>
</QueryOptions>
</DefaultValue>
</Parameter>

Resources