SAP BusinessObjects RESTful Web Service SDK User Guide for Web Intelligence and the BI Semantic Layer - sap

I am trying to Refresh a Document that has Date Prompts in it like Report Begin Date and Report End Date in it and in my xml request i am specifying something like below:
<parameters>
<parameter dpId="DP9" type="prompt" optional="false">
<id>1</id>
<answer constrained="false" type="dateTime">
<values>
<value>2017-01-01T00:00.000+01:00</value>
</values>
</answer>
</parameter>
<parameter dpId="DP9" type="prompt" optional="false">
<id>2</id>
<answer constrained="false" type="dateTime">
<values>
<value>2017-11-01T00:00.000+01:00</value>
</values>
</answer>
</parameter>
</parameters>
but I get 400 Bad Request Error for this, any suggestions ? Thanks in advance.

I think the date values should be specified like:
<value>2017-01-01T00:00.000Z</value>
<value>2017-11-01T00:00.000Z</value>

Related

Name of the user who has processed the cube

There is a code piece in which I have to get the username of the user who has processed the cube or has made any changes in the cube structure.
I have searched in the SSAS DMV's, but didn't find what I needed; I only found the last processed time, but not the name of the user.
Any suggestions?
You can track this using an Extended Event. Add the ProgressReportBegin and ProgressReportEnd events which are for processing. These events include the NTUserName and StartTime fields which you can use to find who processed the cube and when. The Extended Event will need to be running when the cube is processed to capture this. The following is an example XMLA command which can be run when connected to your SSAS database in SSMS to create an Extended Event that tracks cube processing and outputs the results to a file. Of course many of these options are just defaults and you may want to make adjustments as necessary.
https://learn.microsoft.com/en-us/sql/analysis-services/instances/monitor-analysis-services-with-sql-server-extended-events?view=sql-server-2017
<Create xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ObjectDefinition>
<Trace>
<ID>XE_Cube_Process</ID>
<Name>XE_Cube_Process</Name>
<XEvent xmlns="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
<event_session name="XE_Cube_Process" dispatchLatency="0" maxEventSize="0" maxMemory="4" memoryPartition="none" eventRetentionMode="AllowSingleEventLoss" trackCausality="true" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<event package="AS" name="ProgressReportEnd" />
<event package="AS" name="ProgressReportBegin" />
<target package="package0" name="event_file">
<parameter name="filename" value="C:\Test\XE_Cube_Process.xel" />
<parameter name="max_file_size" value="4096" />
<parameter name="max_rollover_files" value="10" />
<parameter name="increment" value="1024" />
</target>
</event_session>
</XEvent>
</Trace>
</ObjectDefinition>
</Create>

Execution of Fetch XML using Web API Dynamics 365

I am using this approach for paging using Fetch XML within Web API.
Web API works perfect when we use simple fetch and it returns pagging cookie along with results if there are more records but when we use complex(where we have link entities) Fetch XML it returns paging cookie but empty e.g.:
<b><cookie pagenumber="2" pagingcookie="" istracking="False" /></b>
Here you can see we have nothing in pagingcookie.
Fetch XML used for query:
<fetch mapping="logical" version="1.0" output-format="xml-platform" count="10" page="1" >
<entity name="invoicedetail" >
<attribute name="invoicedetailid" />
<attribute name="uomid" />
<attribute name="quantity" />
<attribute name="manualdiscountamount" />
<attribute name="priceperunit" />
<attribute name="extendedamount" />
<filter>
<condition entityname="invoice" attribute="customerid" operator="eq" value="{5A8F8B46-2443-E511-80E3-3863BB351E10}" />
</filter>
<link-entity name="invoice" from="invoiceid" to="invoiceid" >
<attribute name="invoiceid" />
<attribute name="invoicenumber" />
<attribute name="description" />
<attribute name="totalamount" />
<order attribute="ss_postingdate" descending="true" />
</link-entity>
</entity>
</fetch>
If we remove linked entity it starts giving the exact paging cookie in the response that can be get using #Microsoft.Dynamics.CRM.fetchxmlpagingcookie.
Is there any way to get the exact paging cookie in complex scenarios?
I've seen this happen before in the standard organization service. I would suggest just paging without the paging cookie - this resolved the issue for me in the organization service.
E.g. <fetch mapping="logical" page="1" count="50">

Converting SQL Query to XML Query for SharePoint List

I'm using SQL Reporting 3.0 and I'm trying to query a SharePoint list. Since the SharePoint list can only be in XML inside of SQL reporting, I'm trying to figure out to to convert my SQL query into an XML query. The area I'm stuck at is inside of WHERE. I'm having difficulty with IN(#). Is there a way to convert this into an XML query? Thank you for your help its greatly appreciated.
SQL Query
SELECT Hours, Date, Project, ID, Created_By,Month
FROM TimeTracking
WHERE Project IN(#Project) AND Month IN(#Month)
XML Query
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>Time Tracking</ListName>
<ViewFields>
<FieldRef Name="Hours" />
<FieldRef Name="Date" />
<FieldRef Name="Project" />
<FieldRef Name="ID" />
<FieldRef Name="Created_By" />
<FieldRef Name="Month" />
</ViewFields>
<Query>
<Where>
?
</Where>
</Query>
</RSSharePointList>
Here's an example on MSDN on using FOR XML PATH to return your query as XML. You can also add a root element by using ROOT.
Please refer to te following article:
http://msdn.microsoft.com/en-us/library/bb510462.aspx

isnull and in statement in CAML

Is it possible to combine the sharepoint <In> statement with the <IsNull> statement? I only managed to get it working using an <Or> but would be great if you could place the <isNull> inside the <In> directly.
Thanks
The solution is as follows:
<Query>
<Where>
<In>
<FieldRef Name='MyLookupField' LookupId='TRUE'/>
<Values>
<Value Type='Lookup'></Value>
<Value Type='Lookup'>1</Value>
</Values>
</In>
</Where>
</Query>

SOAP call with query on result (SSRS, Sharepoint)

I created a report in VS using a shared data source which is connected to a sharepoint list. In the report I created a dataset with a SOAP call to the data source so I get the result from the sharepoint list in a table.
this is the soap call
<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>{BD8D39B7-FA0B-491D-AC6F-EC9B0978E0CE}</DefaultValue>
</Parameter>
<Parameter Name="viewName">
<DefaultValue>{E2168426-804F-4836-9BE4-DC5F8D08A54F}</DefaultValue>
</Parameter>
<Parameter Name="rowLimit">
<DefaultValue>9999</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
THis works fine, I have a result which I can show in a report, but I want to have the ability to select a parameter to filter the result on. I have created a parameter and when I preview the Report I see the dropdownbox which I can use to make a selection from the Title field, when I do this it still shows the first record, obviously it doens't work yet (DUH!) because I need to create a query somewhere, But! I have no idea where, I tried to include
<Where>
<Eq>
<FieldRef Name="ows_Title" />
<Value Type="Text">testValue</Value>
</Eq>
</Where>
in the the soap request but it didn't worked... I've searched teh intarwebz but couldn't find any simliar problems... kinda stuck now...any thoughts on this?
EDIT
Here's the query I used according to the blogpost Alex Angas linked.
<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
<queryOptions></queryOptions>
<query><Query>
<Where>
<Eq>
<FieldRef Name="ows_Title"/>
<Value Type="Text">someValue</Value>
</Eq>
</Where>
</Query></query>
<Parameters>
<Parameter Name="listName">
<DefaultValue>{BD8D39B7-FA0B-491D-AC6F-EC9B0978E0CE}</DefaultValue>
</Parameter>
<Parameter Name="viewName">
<DefaultValue>{E2168426-804F-4836-9BE4-DC5F8D08A54F}</DefaultValue>
</Parameter>
<Parameter Name="rowLimit">
<DefaultValue>9999</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
I tried to put the new query statement in every possible way in the existing, but it doesn't work at all, I do not get an error though so the code is valid, but I still get an unfiltered list as return... pulling my hair out here!
A post at:
http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/1562bc7c-8348-441d-8b59-245d70c3d967/
Suggested using this syntax for placement of the <Query> node (this example is to retrieve the item with an ID of 1):
<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>{CE7A4C2E-D03A-4AF3-BCA3-BA2A0ADCADC7}</DefaultValue>
</Parameter>
<Parameter Name="query" Type="xml">
<DefaultValue>
<Query>
<Where>
<Eq>
<FieldRef Name="ID"/>
<Value Type="Integer">1</Value>
</Eq>
</Where>
</Query>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
However this would give me the following error:
Failed to execute web request for the specified URL
With the following in the details:
Element <Query> of parameter query is missing or invalid
From looking at the SOAP message with Microsoft Network Monitor, it looks as though the <Query> node is getting escaped to <Query> etc, which is why it fails.
However, I was able to get this to work using the method described in Martin Kurek's response at:
http://www.sharepointblogs.com/dwise/archive/2007/11/28/connecting-sql-reporting-services-to-a-sharepoint-list-redux.aspx
So, I used this as my 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>{CE7A4C2E-D03A-4AF3-BCA3-BA2A0ADCADC7}</DefaultValue>
</Parameter>
<Parameter Name="query" Type="xml">
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
And then defined a parameter on the dataset named query, with the following value:
<Query><Where><Eq><FieldRef Name="ID"/><Value Type="Integer">1</Value></Eq></Where></Query>
I was also able to make my query dependent on a report parameter, by setting the query dataset parameter to the following expression:
="<Query><Where><Eq><FieldRef Name=""ID""/><Value Type=""Integer"">" &
Parameters!TaskID.Value &
"</Value></Eq></Where></Query>"
See the question and answers for GetListItems Webservice ignores my query filter. This shows you how (and how not to) set up your SOAP call to include a query. You probably need to wrap your query with another <Query></Query>.
You have your FieldRef as
ows_Title
I believe it should just be Title.
When you get results from the SOAP request all your field name will begin with
ows_
Brilliant, thanks. This solution worked for queryOptions also.
In the Query:
<Parameter Name="queryOptions" Type="xml">
</Parameter>
And in the parameters list of the dataset:
Name: queryOptions
Value: <QueryOptions><Folder>Shared Documents/MyFolder</Folder></QueryOptions>