<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ODATA &#8211; Prologika</title>
	<atom:link href="https://prologika.com/tag/odata/feed/" rel="self" type="application/rss+xml" />
	<link>https://prologika.com</link>
	<description>Business Intelligence Consulting and Training in Atlanta</description>
	<lastBuildDate>Wed, 17 Feb 2016 05:44:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Reporting From OData Services</title>
		<link>https://prologika.com/reporting-from-odata-services/</link>
					<comments>https://prologika.com/reporting-from-odata-services/#respond</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Mon, 26 Apr 2010 02:57:00 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[ODATA]]></category>
		<category><![CDATA[SQL Server 2008 R2]]></category>
		<guid isPermaLink="false">/CS/blogs/blog/archive/2010/04/25/reporting-from-odata-services.aspx</guid>

					<description><![CDATA[Open Data Protocol (OData), previously known as ADO.NET Data Services, is quickly gaining popularity as a web protocol for querying and updating data. A few Microsoft products already expose their [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.odata.org/">Open Data Protocol (OData),</a> previously known as ADO.NET Data Services, is quickly gaining popularity as a web protocol for querying and updating data. A few Microsoft products already expose their functionality as OData services, including SharePoint 2010, SQL Azure, and Reporting Services (see my <a href="/CS/blogs/blog/archive/2009/08/13/reports-as-data-feeds.aspx">blog</a> about reports as data feeds). Therefore, chances are that you may need to report off OData services. As it stands, Reporting Services doesn&#8217;t include a native support for OData but the <a href="http://msdn.microsoft.com/en-us/library/aa964129%28SQL.90%29.aspx">XML Data Provider</a>, which has been around since version 2005, may get the job done.</p>
<p>The <a href="#">OData report</a> demonstrates how you can use the XML Data Provider to query OData services. It has two datasets. The Customers dataset retrieves data from the sample <a href="http://services.odata.org/Northwind/Northwind.svc/Customers">Northwind OData service</a>. The CompanySales dataset queries the Adventure Works Company Sales report as a data feed.</p>
<h2>Northwind OData Service</h2>
<p>The Northwind datasets shows a list of Northwind customers. I implemented the report as follows.</p>
<ol>
<li>Set up the Northwind data source that uses the XML Data Provider and whose connection string points to the Northwind Customers service.<br />
<a href="http://services.odata.org/Northwind/Northwind.svc/Customers">http://services.odata.org/Northwind/Northwind.svc/Customers</a>As you&#8217;ve probably guessed it, you need to set up a data source for each OData service you want to query. If you open the above link in IE with the feed view turned off (Internet Options, Content tab, Settings, uncheck Turn On Feed Reading View), you will see the output of the service.</p>
<p><span style="font-family: Courier New; font-size: 10pt;"><span style="color: blue;">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243; standalone=&#8221;yes&#8221; ?&gt;</span> </span></li>
</ol>
<p><a href="http://services.odata.org/Northwind/Northwind.svc/Customers"><span style="color: red; font-family: Courier New; font-size: 10pt;"><strong>&#8211;</strong></span></a><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;<span style="color: #990000;">feed<span style="color: red;"> xml:base<span style="color: blue;">=&#8221;<span style="color: red;"><strong>http://services.odata.org/Northwind/Northwind.svc/</strong><span style="color: blue;">&#8220;<span style="color: red;"><br />
xmlns:d<span style="color: blue;">=&#8221;<span style="color: red;"><strong>http://schemas.microsoft.com/ado/2007/08/dataservices</strong><span style="color: blue;">&#8220;<span style="color: red;"><br />
xmlns:m<span style="color: blue;">=&#8221;<span style="color: red;"><strong>http://schemas.microsoft.com/ado/2007/08/dataservices/metadata</strong><span style="color: blue;">&#8220;<span style="color: red;"> xmlns<span style="color: blue;">=&#8221;<span style="color: red;"><strong>http://www.w3.org/2005/Atom</strong><span style="color: blue;">&#8220;&gt;</span> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">title type<span style="color: blue;">=&#8221;</span><strong>text</strong><span style="color: blue;">&#8220;&gt;</span><strong>Customers</strong><span style="color: blue;">&lt;/<span style="color: #990000;">title<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">id<span style="color: blue;">&gt;</span><strong>http://services.odata.org/Northwind/Northwind.svc/Customers</strong><span style="color: blue;">&lt;/<span style="color: #990000;">id<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">updated<span style="color: blue;">&gt;</span><strong>2010-04-25T15:07:07Z</strong><span style="color: blue;">&lt;/<span style="color: #990000;">updated<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">link</span> <span style="color: #990000;">rel<span style="color: blue;">=&#8221;</span><strong>self</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> title<span style="color: blue;">=&#8221;</span><strong>Customers</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> href<span style="color: blue;">=&#8221;</span><strong>Customers</strong><span style="color: blue;">&#8221; /&gt;</span> </span></span></span></span></span></span></span></p>
<p style="margin-left: 12pt;"><a href="http://services.odata.org/Northwind/Northwind.svc/Customers"><span style="color: red; font-family: Courier New; font-size: 10pt;"><strong>&#8211;</strong></span></a><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;<span style="color: #990000;">entry<span style="color: blue;">&gt;</span> </span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">id<span style="color: blue;">&gt;</span><strong>http://services.odata.org/Northwind/Northwind.svc/Customers(&#8216;ALFKI&#8217;)</strong><span style="color: blue;">&lt;/<span style="color: #990000;">id<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">title</span> <span style="color: #990000;">type<span style="color: blue;">=&#8221;</span><strong>text</strong><span style="color: blue;">&#8221; /&gt;</span> </span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">updated<span style="color: blue;">&gt;</span><strong>2010-04-25T15:07:07Z</strong><span style="color: blue;">&lt;/<span style="color: #990000;">updated<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><a href="http://services.odata.org/Northwind/Northwind.svc/Customers"><span style="color: red; font-family: Courier New; font-size: 10pt;"><strong>&#8211;</strong></span></a><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;<span style="color: #990000;">author<span style="color: blue;">&gt;</span> </span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">name</span> /&gt;</span> </span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;/<span style="color: #990000;">author<span style="color: blue;">&gt;</span> </span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">link</span> <span style="color: #990000;">rel<span style="color: blue;">=&#8221;</span><strong>edit</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> title<span style="color: blue;">=&#8221;</span><strong>Customer</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> href<span style="color: blue;">=&#8221;</span><strong>Customers(&#8216;ALFKI&#8217;)</strong><span style="color: blue;">&#8221; /&gt;</span> </span></span></span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">link</span> <span style="color: #990000;">rel<span style="color: blue;">=&#8221;</span><strong>http://schemas.microsoft.com/ado/2007/08/dataservices/related/Orders</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> type<span style="color: blue;">=&#8221;</span><strong>application/atom+xml;type=feed</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> title<span style="color: blue;">=&#8221;</span><strong>Orders</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> href<span style="color: blue;">=&#8221;</span><strong>Customers(&#8216;ALFKI&#8217;)/Orders</strong><span style="color: blue;">&#8221; /&gt;</span> </span></span></span></span></span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">link</span> <span style="color: #990000;">rel<span style="color: blue;">=&#8221;</span><strong>http://schemas.microsoft.com/ado/2007/08/dataservices/related/CustomerDemographics</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> type<span style="color: blue;">=&#8221;</span><strong>application/atom+xml;type=feed</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> title<span style="color: blue;">=&#8221;</span><strong>CustomerDemographics</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> href<span style="color: blue;">=&#8221;</span><strong>Customers(&#8216;ALFKI&#8217;)/CustomerDemographics</strong><span style="color: blue;">&#8221; /&gt;</span> </span></span></span></span></span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">category</span> <span style="color: #990000;">term<span style="color: blue;">=&#8221;</span><strong>NorthwindModel.Customer</strong><span style="color: blue;">&#8220;<span style="color: #990000;"> scheme<span style="color: blue;">=&#8221;</span><strong>http://schemas.microsoft.com/ado/2007/08/dataservices/scheme</strong><span style="color: blue;">&#8221; /&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><a href="http://services.odata.org/Northwind/Northwind.svc/Customers"><span style="color: red; font-family: Courier New; font-size: 10pt;"><strong>&#8211;</strong></span></a><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;<span style="color: #990000;">content type<span style="color: blue;">=&#8221;</span><strong>application/xml</strong><span style="color: blue;">&#8220;&gt;</span> </span></span></span></p>
<p style="margin-left: 12pt;"><a href="http://services.odata.org/Northwind/Northwind.svc/Customers"><span style="color: red; font-family: Courier New; font-size: 10pt;"><strong>&#8211;</strong></span></a><span style="font-family: Courier New; font-size: 10pt;"> <span style="color: blue;">&lt;<span style="color: #990000;">m:properties<span style="color: blue;">&gt;</span> </span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:CustomerID<span style="color: blue;">&gt;</span><strong>ALFKI</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:CustomerID<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:CompanyName<span style="color: blue;">&gt;</span><strong>Alfreds Futterkiste</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:CompanyName<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:ContactName<span style="color: blue;">&gt;</span><strong>Maria Anders</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:ContactName<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:ContactTitle<span style="color: blue;">&gt;</span><strong>Sales Representative</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:ContactTitle<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:Address<span style="color: blue;">&gt;</span><strong>Obere Str. 57</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:Address<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:City<span style="color: blue;">&gt;</span><strong>Berlin</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:City<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:Region</span> <span style="color: #990000;">m:null<span style="color: blue;">=&#8221;</span><strong>true</strong><span style="color: blue;">&#8221; /&gt;</span> </span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:PostalCode<span style="color: blue;">&gt;</span><strong>12209</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:PostalCode<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:Country<span style="color: blue;">&gt;</span><strong>Germany</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:Country<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:Phone<span style="color: blue;">&gt;</span><strong>030-0074321</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:Phone<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;<span style="color: #990000;">d:Fax<span style="color: blue;">&gt;</span><strong>030-0076545</strong><span style="color: blue;">&lt;/<span style="color: #990000;">d:Fax<span style="color: blue;">&gt;</span> </span></span></span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-family: Courier New; font-size: 10pt;"><span style="color: red;"><strong> </strong></span> <span style="color: blue;">&lt;/<span style="color: #990000;">m:properties<span style="color: blue;">&gt;</span> </span></span></span></p>
<p style="margin-left: 12pt;"><span style="font-size: 10pt;"><span style="color: red; font-family: Courier New;"><strong> </strong></span><span style="font-family: Courier New;"> <span style="color: blue;">&lt;/<span style="color: #990000;">content<span style="color: blue;">&gt;</span></span></span></span><span style="font-family: Verdana;"><br />
</span></span></p>
<ol>
<li>
<div>Set up a dataset query.</div>
<p><span style="font-family: Courier New;">&lt;Query&gt; </span></p>
<p><span style="font-family: Courier New;">    &lt;ElementPath IgnoreNamespaces=&#8221;true&#8221;&gt; </span></p>
<p><span style="font-family: Courier New;">        feed{}/entry{}/content{}/properties </span></p>
<p><span style="font-family: Courier New;">    &lt;/ElementPath&gt; </span></p>
<p><span style="font-family: Courier New;">&lt;/Query&gt; </span></p>
<p>&nbsp;</p>
<p>The IgnoreNamespaces attribute instructs the provider to ignore the XML namespaces. The ElementPath text specifies a path to the element whose nodes you want to display. In this case, the element is properties which is the element that contains the interesting OData stuff. The empty curly braces for the preceding nodes are used to ignore information from the preceding nodes in the path.</li>
</ol>
<h2>CompanySales</h2>
<p>Since starting with R2, reports are available as data feeds, you may also implement a quick and easy way to display data from one report in another. In this <a href="/CS/blogs/blog/archive/2010/03/30/feeding-reports-by-code.aspx">blog</a>, I provided more details about the query syntax. In the case of the Company Sales, the data source connection string is as follows:</p>
<p><span style="font-family: Courier New;">http://localhost/ReportServerR2?/Adventure Works Sample Reports/Company Sales 2008&amp;ShowDescription=False&amp;StartDate=01/01/2002 00:00:00&amp;EndDate=12/31/2003 00:00:00&amp;rs:ParameterLanguage=&amp;rs:Command=Render&amp;rs:Format=ATOM&amp;rc:DataFeed=xAx0x2xCx0xMx0 </span></p>
<p>The dataset query is the same because all OData services return data in the same format.</p>
<p>Moving forward, it will be nice if a future release includes a native OData provider that handles parameters and supports methods, as the XML Data Provider does for SOAP web methods, so you don&#8217;t have to set up a data source for each OData service.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/reporting-from-odata-services/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
