<?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>ssrs Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/ssrs/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/ssrs/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Wed, 19 Mar 2025 12:46:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>ssrs Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/ssrs/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Import Google Analytics data into SQL Server / Reporting / ETL</title>
		<link>https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 25 May 2019 19:17:14 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[ODBC Gateway]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[T-SQL (SQL Server)]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[openquery]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[ssms]]></category>
		<category><![CDATA[ssrs]]></category>
		<category><![CDATA[t-sql]]></category>
		<category><![CDATA[tableau]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7003</guid>

					<description><![CDATA[<p>Introduction In our previous article we saw how to read Google Analytics data using SSIS. But what if you don&#8217;t use SSIS and you still like to Import Google Analytics data into SQL Server or Read inside other Reporting / ETL Apps (e.g. Excel, Power BI, MS Access &#8230; and many more). Not all BI [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/">Import Google Analytics data into SQL Server / Reporting / ETL</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png"><img decoding="async" class=" wp-image-7056 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png" alt="" width="162" height="162" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png 250w, https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo-150x150.png 150w" sizes="(max-width: 162px) 100vw, 162px" /></a>In our previous article we saw how to <a href="https://zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/">read Google Analytics data using SSIS</a>. But what if you don&#8217;t use SSIS and you still like to Import Google Analytics data into SQL Server or Read inside other Reporting / ETL Apps (e.g. Excel, Power BI, MS Access &#8230; and many more). Not all BI tools comes with native driver / connectivity for Google Analytics. Sometimes they do offer Google Analytics connectivity but don&#8217;t offer feature you looking for (e.g. Sort, Segment Filter). In such case you have to look for solution outside.</p>
<p>Well not to worry we will show you how simple it is to connect to Google Analytics using <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">ZappySys JSON Driver (For REST API / Files)</a> in few mins. This driver is one of the best REST API drivers you can find in the market. It is so generic that it can virtually access any REST API you may find internally or on public sites (e.g. Facebook, Salesforce, Azure, AWS). Check <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-drivers/json-rest-api-driver/" target="_blank" rel="noopener">these articles</a> to see many more use cases of JSON Driver.</p>
<p>At the end of this article you will learn how to Query Google Analytics data in <strong>SSMS</strong> like below (Yes that&#8217;s correct .. Pretty Awesome!!! ).</p>
<div id="attachment_7046" style="width: 649px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7046" class="size-full wp-image-7046" src="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png" alt="Import Google Analytics Data into SQL Server Table (using T-SQL Code)" width="639" height="538" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png 639w, https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server-300x253.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></a><p id="caption-attachment-7046" class="wp-caption-text">Import Google Analytics Data into SQL Server Table (using T-SQL Code)</p></div>
<div class="content_block" id="custom_post_widget-7048"><h2>Requirements</h2>
This article talks about few tools and techniques in order to load API data in SQL Server. Please make sure following prerequisites are met.
<ol>
 	<li>Download and Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (This includes XML / JSON / REST API and few other drivers for SQL Server and ODBC connectivity in tools like Excel, Power BI, SSRS)</li>
 	<li>Make sure you have access to SQL Server Instance. If you cant find one still want to try what is mentioned in this article then install <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express" target="_blank" rel="noopener">FREE SQL Express Edition</a></li>
 	<li>Confirm that you have SSMS Installed. If you don't have then you can download <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017">from here</a>.</li>
</ol></div>
<h2>Testing Google Analytics API</h2>
<p>If you are new to Google Analytics API then read little bit about <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#data_request" target="_blank" rel="noopener">Google Analytics REST API here</a>. Google also offers a really good way to test Analytics API using <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">Query Explorer Tool here</a>. So please check that and understand how to craft correct REST API URL which will be used in the next section.</p>
<div id="attachment_7021" style="width: 908px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7021" class="size-full wp-image-7021" src="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png" alt="Using Google Analytics Query Explorer Tool - Create REST API Url (Dimension / Metrics Selection Browser)" width="898" height="1379" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png 898w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-195x300.png 195w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-768x1179.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-667x1024.png 667w" sizes="(max-width: 898px) 100vw, 898px" /></a><p id="caption-attachment-7021" class="wp-caption-text">Using Google Analytics Query Explorer Tool &#8211; Create REST API Url (Dimension / Metrics Selection Browser)</p></div>
<h3>Sample Google Analytics API Response</h3>
<p>Behind the scene here is how API Request and Response Looks like for Google Analytics REST API. Notice that <strong>Authorization</strong> Header in below request is automatically added by ZappySys Driver or Query Testing tool above. Also notice <strong>nextLink</strong> attribute in response, its used to fetch more data. By default each response contains upto 10000 rows.</p>
<p><strong>Request</strong></p><pre class="crayon-plain-tag">GET https://www.googleapis.com/analytics/v3/data/ga?ids=ga:185737326&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration&amp;dimensions=ga:date
Authorization: Bearer ya29.GlwUxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</pre><p>
<strong>Response</strong></p><pre class="crayon-plain-tag">{
    "kind": "analytics#gaData",
    "id": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday",
    "query": {
        "start-date": "30daysAgo",
        "end-date": "yesterday",
        "ids": "ga:123456789",
        "dimensions": "ga:date",
        "metrics": ["ga:avgSessionDuration"],
        "start-index": 1,
        "max-results": 1000
    },
    "itemsPerPage": 1000,
    "totalResults": 30,
    "selfLink": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday",
    "nextLink": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;start-index=10001&amp;max-results=10000",
    "profileInfo": {
        "profileId": "123456789",
        "accountId": "33445566",
        "webPropertyId": "UA-33445566-3",
        "internalWebPropertyId": "454545454",
        "profileName": "All Web Site Data",
        "tableId": "ga:123456789"
    },
    "containsSampledData": false,
    "columnHeaders": [
        {
            "name": "ga:date",
            "columnType": "DIMENSION",
            "dataType": "STRING"
        },
        {
            "name": "ga:avgSessionDuration",
            "columnType": "METRIC",
            "dataType": "TIME"
        }
    ], "totalsForAllResults": {
        "ga:avgSessionDuration": "49.3779488037477"
    },
    "rows": [ 
		["20190425", "401.38912133891213"], 
		["20190426", "512.49723756906077"], 
		["20190427", "11.53488372093024"], 
		["20190428", "432.148648648648646"], 
		["20190429", "234.650735294117645"],
		.......
		.......
		.......
		.......
		["20190525", "74.123435294117645"]
	]
}</pre><p>
&nbsp;</p>
<h2>Creating Google API Project (Obtain Client ID / Secret)</h2>
<p>Very first step to call any Google API including Google Analytics is to create Google API Project and register OAuth App to obtain <strong>Client ID</strong> and <strong>Client Secret</strong>. If you dont want to go through this hassle and start easy way then ZappySys offers Inbuilt Default App on <strong>OAuth</strong> Connection UI but <strong>we strongly recommend</strong> you create your own app rather than using Default App because in Default App API call limit is shared by many. Your data is never shared with ZappySys in any case even you use Default App.</p>
<p>Here is how to <a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/">create API Project to call Google API</a>. Once you create Google API Project make sure you <strong>enable</strong> <strong>Google Analytics API</strong>.</p>
<p>So once you have <strong>Client ID</strong> and <strong>Client Secret</strong> we can move forward to the next step.</p>
<h2>Loading Google Analytics data into SQL Server</h2>
<p>In our previous article we saw in depth general idea on how to <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/">import REST API data in SQL Server (T-SQL Script)</a> without relying on any ETL tools.  Now lets look at step by step on <strong>how to load Google Analytics data into SQL Server</strong>.</p>
<p>In this example, our goal is to extract a Google Analytics report which shows average session duration and new users count by date (For last 30 days).</p>
<h3>Setup ZappySys Data Gateway</h3>
<p>Very first step to access any REST API Data inside SQL Server is to configure ZappySys Data Gateway. We covered this in <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">previous article</a>.  But here are high level steps for initial setup of Data Gateway.</p>
<ol>
<li>Search for Gateway in Start menu and  Select ZappySys Data Gateway
<div id="attachment_5283" style="width: 410px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5283" class="size-full wp-image-5283" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" width="400" height="315" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png 400w, https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway-300x236.png 300w" sizes="(max-width: 400px) 100vw, 400px" /></a><p id="caption-attachment-5283" class="wp-caption-text">Open ZappySys Data Gateway</p></div></li>
<li>Create <strong>new User</strong> in Data gateway on Users tab. Enter username and password (we will use this when we create Linked Server) . <strong><strong><strong>Check Admin Option</strong></strong></strong>
<div id="attachment_5285" style="width: 426px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5285" class="size-full wp-image-5285" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png" alt="Add Data Gateway User" width="416" height="444" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png 416w, https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user-281x300.png 281w" sizes="(max-width: 416px) 100vw, 416px" /></a><p id="caption-attachment-5285" class="wp-caption-text">Add Data Gateway User</p></div></li>
</ol>
<h3>Setup Google Analytics API Data Source in Gateway / ODBC</h3>
<p>Once gateway user is setup, now lets create a new Data Source for Google Analytics API. In this section we will talk how to create data source in gateway but most instructions can be used to create data source in ODBC too. At the end of this article we explained how to Launch ODBC Datasource UI. Step#1 and 2 are only different, all other steps same in ODBC DSN creation.</p>
<ol>
<li>Click Add Data Source option (Select Native &#8211; JSON Driver )
<div id="attachment_5284" style="width: 568px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5284" class="size-full wp-image-5284" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png" alt="Add Gateway Data Source (Native JSON Driver)" width="558" height="533" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png 558w, https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source-300x287.png 300w" sizes="(max-width: 558px) 100vw, 558px" /></a><p id="caption-attachment-5284" class="wp-caption-text">Add Gateway Data Source (Native JSON Driver)</p></div></li>
<li>Click Edit to configure data source
<div id="attachment_5440" style="width: 572px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5440" class="size-full wp-image-5440" src="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png" alt="Edit Gateway Data Source Settings" width="562" height="385" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png 562w, https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2-300x206.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></a><p id="caption-attachment-5440" class="wp-caption-text">Edit Gateway Data Source Settings</p></div></li>
<li>Now lets configure Driver settings.  Click on Load Connection String button.
<div id="attachment_7024" style="width: 996px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7024" class="size-full wp-image-7024" src="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png" alt="Load ZappySys Driver ConnectionString to configure UI" width="986" height="454" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png 986w, https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring-300x138.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring-768x354.png 768w" sizes="(max-width: 986px) 100vw, 986px" /></a><p id="caption-attachment-7024" class="wp-caption-text">Load ZappySys Driver ConnectionString to configure UI</p></div></li>
<li>Enter the following ConnectionString to get started with predefined settings.<br />
Change ids (<strong>111223344</strong> to your own Profile ID in <strong>DataPath URL</strong>). Other URL Parameters explained in next section.<br />
<pre class="crayon-plain-tag">DRIVER={ZappySys JSON Driver};
DataPath='https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date';
DataConnectionType=OAuth;
ScopeSeparator='{space}';
Scope='https://www.googleapis.com/auth/analytics https://www.googleapis.com/auth/analytics.readonly';
ServiceProvider=Google;
Filter='$.rows[*]';
ArrayTransformType=TransformSimpleTwoDimensionalArray;
ArrayTransColumnNameFilter='$.columnHeaders[*].name';
RequestMethod='GET';
NextUrlAttributeOrExpr='$.nextLink';
ClientId='xxxxxxxxxxxx';
ClientSecret='yyyyyyyyyyyyyy';
UseCustomApp='True'</pre>
&nbsp;</li>
<li>URL used in DataPath is most important (parameters explained below) . You can use   <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">Query Explorer Tool here</a> to build same URL.<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date</pre>
<strong><span style="text-decoration: underline;">Parameters Explained </span><br />
</strong><br />
Here is some required parameters used in above REST API URL.<br />
<strong>ids</strong>=ga:11223344<br />
This is your Profile ID which you like to extract.  <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#ids">Read more</a><strong><br />
start-date</strong>=30daysAgo<br />
This can be yyyy-MM-dd or some other some predefined date keywords (e.g today, yesterday 10daysAgo). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#startDate" target="_blank" rel="noopener">Read more</a>.<br />
<strong>end-date</strong>=yesterday<br />
Same as above<br />
<strong>metrics</strong>=ga:avgSessionDuration,ga:newUsers<br />
This can be comma separated list of metrics you like to extract (max 10). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#metrics" target="_blank" rel="noopener">Read more</a>.<br />
<strong>dimensions</strong>=ga:date<br />
This can be comma separated list of metrics you like to extract (max 7). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#dimensions" target="_blank" rel="noopener">Read more</a>.</li>
<li>Now its time to configure <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">OAuth</a> settings. Click on Configure Connection. Enter Client ID and Client Secret Obtained in the previous section (<a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/" target="_blank" rel="noopener">see here</a>) and then click Generate Token as below.
<div id="attachment_7043" style="width: 1006px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7043" class="size-full wp-image-7043" src="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png" alt="Configure Google API Data Source / DSN (Google Analytics API Example)" width="996" height="870" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png 996w, https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth-300x262.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth-768x671.png 768w" sizes="(max-width: 996px) 100vw, 996px" /></a><p id="caption-attachment-7043" class="wp-caption-text">Configure Google API Data Source / DSN (Google Analytics API Example)</p></div></li>
<li>Thats it now can click on Preview Tab and run sample query like below.<br />
<pre class="crayon-plain-tag">select * from $</pre>
<strong>&#8211;OR&#8211;</strong><br />
(Select Table name from dropdown and generate default query and then you can add alias , remove unwanted columns)<br />
<pre class="crayon-plain-tag">SELECT 
"ga:date" date, 
"ga:avgSessionDuration" avgSessionDuration,
"ga:newUsers" newUsers
FROM "rows"</pre>
<strong>&#8211;OR&#8211;</strong><br />
(Type custom query with your own URL generated <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">from here</a>, Change Profile ID &#8211; from 11223344 to your own id)<br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 Src='https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date'
	,IncludeParentColumns='False'
)</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-7045" src="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png" alt="" width="652" height="608" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png 652w, https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data-300x280.png 300w" sizes="(max-width: 652px) 100vw, 652px" /></a></li>
</ol>
<h3>Create Linked Server in SQL Server using T-SQL Script</h3>
<p>Once our Gateway Data Source is configured we can now move to SQL Server Part to define Linked Server.</p>
<p>Here is how you can define linked server to access Google Analytics Data inside SQL Server. There are two ways to create Linked Server (1)  via T-SQL script (2) via SSMS UI)</p>
<p>Here is how to create using Script.</p><pre class="crayon-plain-tag">USE [master]
GO

--drop existing linked server for same name if already found
EXEC master.dbo.sp_dropserver @server=N'GOOGLE_ANALYTICS_LS', @droplogins='droplogins'
GO

EXEC master.dbo.sp_addlinkedserver 
	@server = N'GOOGLE_ANALYTICS_LS', 
	@srvproduct=N'', 
	@provider=N'SQLNCLI', 
	@datasrc=N'localhost,5000', --this is host name and port number where  ZappySys Data Gateway is running
	@catalog=N'ZS-GA' --this must be same name as defined on Data Source tab Grid on ZappySys Data Gateway

EXEC master.dbo.sp_addlinkedsrvlogin 
	@rmtsrvname=N'GOOGLE_ANALYTICS_LS',
	@useself=N'False',
	@locallogin=NULL,
	@rmtuser=N'SOME-GATEWAY-USER', -- user name created on ZappySys Data Gateway
	@rmtpassword='SOME-GATEWAY-PASSWORD' -- password for ZappySys Data Gateway user
GO</pre><p>
&nbsp;</p>
<h3>Create Microsoft SQL Server Linked Server using SSMS UI</h3>
<div class="content_block" id="custom_post_widget-5289">Once you configured data source in Gateway, we can now setup Linked Server in SQL Server to query API data.
<ol style="margin-left: 10px;">
 	<li>Assuming you have installed SQL Server and SSMS. If not then get both for FREE from here: <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express">Get SQL Server Express</a> and  <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_blank" rel="noopener">Get SSMS</a></li>
 	<li>Open SSMS and connect to SQL Server.</li>
 	<li>Go to Root &gt; Server Objects &gt; Linked Servers node. Right click and click <strong>New Linked Server...
</strong>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png" alt="Add Linked Server in SQL Server" />
</a>
<p class="wp-caption-text">Add Linked Server in SQL Server</p>

</div></li>
 	<li> Now enter linked server name, select Provider as SQL Native Client</li>
 	<li>Enter data source as <strong><span class="lang:default decode:true crayon-inline">GatewayServerName,PORT_NUMBER</span></strong> where server name is where ZappySys Gateway is running (Can be same as SQL Server machine or remote machine). Default PORT_NUMBER is 5000 but confirm on Data gateway &gt; General tab incase its different.</li>
 	<li>Enter Catalog Name. This must match name from Data gateway Data sources grid &gt; Name column
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png" alt="Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection" />
</a>
<p class="wp-caption-text">Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection</p>
</div>
<div style="color: #31708f;background-color: #d9edf7;border-color: #bce8f1;padding: 15px;margin-bottom: 20px;border: 1px solid transparent;border-radius: 4px;">
<strong>INFO:</strong><br/>
<ul>
    <li>
      For <strong>SQL Server 2012, 2014, 2016, 2017, and 2019</strong>, use the <em>SQL Server Native Client 11.0</em> as the Provider.
    </li>
    <li>
      For <strong>SQL Server 2022 or higher</strong>, use the <em>Microsoft OLE DB Driver for SQL Server</em> as the Provider.
    </li>
  </ul>
</div></li>
 	<li>Click on Security Tab and select last option "<strong>Be made using this security context</strong>". Enter your gateway user account here.</li>
<li>
        <p>Optional: Under the Server Options Tab, Enable <b>RPC</b> and <b>RPC Out</b> and Disable Promotion of Distributed Transactions<b>(MSDTC)</b>.</p>
		<div class="wp-caption alignnone">
			<img decoding="async" class="block margin-bottom-10 img-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/11/linked-server-options-rpc-msdtc.png" title="RPC and MSDTC Settings" alt="RPC and MSDTC Settings" />
			<p class="wp-caption-text">RPC and MSDTC Settings</p>
		</div>
        <hr />
        <p>
            You need to enable RPC Out if you plan to use <b><i>EXEC(...) AT [MY_LINKED_SERVER_NAME]</i></b> rather than OPENQUERY.
            <br />
            If don't enabled it, you will encounter the <i>'Server "MY_LINKED_SERVER_NAME" is not configured for RPC'</i> error.
        </p>
        <p>
            Query Example:
            <code class="sql">EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</code>
        </p>
        <hr />
        <p>
            If you plan to use <b><i>'INSERT INTO...EXEC(....) AT [MY_LINKED_SERVER_NAME]'</i></b> in that case you need to Disable Promotion of Distributed Transactions(MSDTC).
            <br />
            If don't disabled it, you will encounter the <i>'The operation could not be performed because OLE DB provider "SQLNCLI11/MSOLEDBSQL" for linked server "MY_LINKED_SERVER_NAME" was unable to begin a distributed transaction.'</i> error.
        </p>
        <p>
            Query Example:
<pre class="">Insert Into dbo.Products 
EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</pre>
        </p>
        <hr />
</li>
 	<li>Click OK to save Linked Server</li>
 	<li>In SSMS execute below SQL query to test your connectivity.
<pre class="">SELECT * FROM OPENQUERY( MY_LINKED_SERVER_NAME, 'SELECT * FROM $')</pre>
--OR--
<pre class="">SELECT * FROM OPENQUERY( MY_LINKED_SERVER_NAME, 
'SELECT * FROM $
 WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json''
 ,Filter=''$.value[*]''
 ,DataFormat=''OData''
)');</pre>
</li>
 	<li>Here is the preview after you run some REST API query in SQL Server. Notice that you can override default configuration by supplying <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-connectionstring.htm" target="_blank" rel="noopener">many parameters</a> in WITH clause (second query example in screenshot).
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-sql-server-linked-server-openquery-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-sql-server-linked-server-openquery-zappysys-data-gateway.png" alt="SSMS Output - Query REST API via Linked Server OPENQUERY statement (Connect to ZappySys Data Gateway)" />
</a>
<p class="wp-caption-text">SSMS Output - Query REST API via Linked Server OPENQUERY statement (Connect to ZappySys Data Gateway)</p>

</div></li>
 	<li>You can wrap your queries inside View or wrap inside Stored procedure to parameterize. Here is an example of create view which calls REST API queries. Below View can be consumed like a normal table from any Tools or Programming Language which supports connectivity to SQL Server.
<pre class="lang:tsql decode:true ">CREATE VIEW dbo.vwApiInvoices 
AS 
/*Call REST API inside SQL Server View*/
SELECT * FROM OPENQUERY( LS , 
'SELECT * FROM $
WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json''
	 ,Filter=''$.value[*]''
	 ,DataFormat=''OData''
)');

GO
</pre>
&nbsp;</li>
 	<li>Notice in above approach if you parameterize Stored Procedure then <a href="https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/" target="_blank" rel="noopener">check this article to understand Dynamic Metadata</a>.</li>
 	<li>That's it. We are now ready to move forward with more interesting things in next section.</li>
</ol></div>
<h3>Import Google Analytics Data into SQL Server Table (T-SQL Code)</h3>
<p>Now lets see how to run sample query to import Google Analytics Data into SQL Server. Notice that how we have escaped quotes in <strong>OPENQUERY</strong>.<br />
<strong>NOTE:</strong> Change id 11223344 with your own Id (<a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">use this tool</a> to create URL)</p><pre class="crayon-plain-tag">select * into GaApiLoad from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
 )
')
select * from GaApiLoad</pre><p>
<div id="attachment_7046" style="width: 649px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7046" class="size-full wp-image-7046" src="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png" alt="Import Google Analytics Data into SQL Server Table (using T-SQL Code)" width="639" height="538" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png 639w, https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server-300x253.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></a><p id="caption-attachment-7046" class="wp-caption-text">Import Google Analytics Data into SQL Server Table (using T-SQL Code)</p></div>
<h2>Expose Google Analytics Data as View</h2>
<p>To make it simple you can expose above query as SQL Server views so you can access them from any Reporting / ETL Tools.</p><pre class="crayon-plain-tag">CREATE VIEW vw_Google_Analytics_BounceRate_PageViews_Last30Days
AS
--change ids to your own Profile ID
select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=2019-04-01&amp;end-date=2019-04-30&amp;metrics=ga:bounceRate,ga:uniquePageviews&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
 )
')
GO</pre><p>
<h2>Making things Dynamic using Stored Procedure with Parameters</h2>
<p>Now let&#8217;s make few things dynamic. We will change above query so we can pass Id, Dimensions and Metrics as parameters.</p>
<p>Run below script to Create a stored proc and fetch google analytics data in SQL Server.</p><pre class="crayon-plain-tag">use MyDatabase
go
create proc usp_GoogleAnalyticsData
	@ids varchar(1000),
	@startDate varchar(50)='30daysAgo',
	@endDate varchar(50)='yesterday',
	@metrics varchar(200)='ga:avgSessionDuration,ga:newUsers',
	@dimensions varchar(200)='ga:date'	
as

declare @sql varchar(4000)

set @sql='select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
''SELECT * FROM "rows"
WITH 
 (
   SRC=''''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:' + @ids 
   +'&amp;start-date='+ @startDate 
   +'&amp;end-date='+ @endDate 
   +'&amp;metrics='+ @metrics 
   +'&amp;dimensions='+ @dimensions 
   +'''''
  ,IncludeParentColumns=''''False''''
 )
'')'

print @sql
execute(@sql)

go

--Example: query google analytics data
exec usp_GoogleAnalyticsData 
	@ids='11223344',  --Change this ID - Obtain from here https://ga-dev-tools.appspot.com/query-explorer/
	@startDate ='30daysAgo',  --or like this 2019-04-01
	@endDate   ='yesterday', --or like this 2019-04-30
	@dimensions='ga:date', 
	@metrics   ='ga:bounceRate,ga:uniquePageviews'</pre><p>
<h3>Insert Google Analytics Data into table (Save Stored Procedure Output)</h3>
<p>Now what if you like to save Stored Proc output into a table? Well for that you must create table with same structure as stored proc output and then use <strong>INSERT INTO</strong> sql like below.</p><pre class="crayon-plain-tag">--import google analytics data in a table
if(object_id('GaDataLoad') is not null)
	drop table GaDataLoad
create table GaDataLoad([Date] date, BounceRate numeric(10,5), PageViews numeric(10,5))  

insert into GaDataLoad
exec usp_GoogleAnalyticsData 
	@ids='11223344',  --Change this ID - Obtain from here https://ga-dev-tools.appspot.com/query-explorer/
	@startDate ='30daysAgo',  --or like this 2019-04-01
	@endDate   ='yesterday', --or like this 2019-04-30
	@dimensions='ga:date', 
	@metrics='ga:bounceRate,ga:uniquePageviews'

select * from GaDataLoad</pre><p>
&nbsp;</p>
<h2>Performance Tips / Handling data errors due to missing rows</h2>
<p>By default ZappySys API Drivers sends minimum 2 API requests. First one to fetch metadata and second, third&#8230; for Data. There will be a time when you wont have any data and it may throw error about no records found because it fails to parse metadata. You can avoid such issue by supplying metadata before hand so you can avoid expensive API calls. <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">Check this article</a> see how you can supply cached metadata in your SQL Query as below. This will avoid Metadata call and speedup significantly. It will also avoid errors due to no rows found for specified criteria.</p><pre class="crayon-plain-tag">select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:bounceRate,ga:uniquePageviews&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
  ,Meta=''[ 
     {"Name": "ga:date","Type": "String", "Length": 16 },
     {"Name": "ga:bounceRate", "Type": "String", "Length": 36 },
     {"Name": "ga:uniquePageviews", "Type": "String", "Length": 10 }
    ]''
 )
')</pre><p>
&nbsp;</p>
<h2>ODBC Connection &#8211; Google Analytics Data in Other Apps (e.g. SSRS / Power BI / Excel / Tableau)</h2>
<p>So far we have talked accessing data inside SQL Server using Data Gateway Approach but what if you like to access in other apps ? Well you have three options.</p>
<ol>
<li>Use Microsoft SQL Server Driver to call Linked Server Queries (OPENQUERY approach we saw earlier)</li>
<li>Access Google Analytics Data using ODBC connectivity</li>
<li>Use Microsoft SQL Server Driver to send direct SQL queries to Gateway (Bypass Linked Server &#8211; Use inner SQL query without OPENQUERY in this case)</li>
</ol>
<h3><strong>Method-1 : Linked Server Approach</strong></h3>
<p>First approach most likely works in all cases because most apps will support connecting to SQL Server using OLEDB / ADO.net / ODBC / JDBC Drivers. So calling SQL Queries which uses Linked Server (i.e. OPENQUERY statement)  is advisable.</p>
<h3><strong>Method-2 : ODBC Driver Approach</strong></h3>
<p>However in some cases this may not be possible (e.g. You don&#8217;t have SQL Server inhouse or you don&#8217;t want to rely on SQL Server to access API). In such case you can use ODBC connectivity in your app. Since ODBC is widely adopted standard most app out there (Except JAVA apps) should support ODBC Drivers. If you like to use this approach then create ODBC DSN rather than Data Gateway Data source and use it in your Reporting / ETL / Custom Apps.</p>
<p>&nbsp;</p>
<div id="attachment_6213" style="width: 404px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6213" class="wp-image-6213 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png" alt="Open ODBC Data Sources (Create DSN)" width="394" height="542" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png 394w, https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2-218x300.png 218w" sizes="(max-width: 394px) 100vw, 394px" /></a><p id="caption-attachment-6213" class="wp-caption-text">Open ODBC Data Sources (Create DSN)</p></div>
<div id="attachment_3993" style="width: 1067px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3993" class="size-full wp-image-3993" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png" alt="ODBC User DSN Tab: Add new Driver Screen" width="1057" height="422" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png 1057w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-300x120.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-768x307.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-1024x409.png 1024w" sizes="(max-width: 1057px) 100vw, 1057px" /></a><p id="caption-attachment-3993" class="wp-caption-text">ODBC User DSN Tab: Add new Driver Screen</p></div>
<p>&nbsp;</p>
<h3><strong>Method-3 : Direct connection to Data Gateway (By pass Linked Server)</strong></h3>
<p>Last option we suggest for cases like JAVA Apps / Linux / Mac machines where you cannot install ZappySys ODBC Drivers and you dont have option to use SQL Server Linked Server either. In such case you can try to send SQL Queries to Gateway directly using Microsoft SQL Server Compatible Drivers (i.e. ODBC /JDBC). <a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">See this example</a> how we called API Queries inside JAVA Apps.</p>
<h3>Google Analytics / REST API Integration in various apps</h3>
<div class="content_block" id="custom_post_widget-7051">ZappySys ODBC Drivers built using ODBC standard which is widely adopted by industry for a long time. Which mean the majority of BI Tools / Database Engines / ETL Tools already there will support native / 3rd party ODBC Drivers. Below is the small list of most popular tools / programming languages our Drivers support. If your tool / programming language doesn't appear in the below list, which means we have not documented use case but as long as your tool supports ODBC Standard, our drivers should work fine.

&nbsp;

<img loading="lazy" decoding="async" class="" src="//zappysys.com/images/odbc-powerpack/odbc-powerpack-integration.jpg" alt="ZappySys ODBC Drivers for REST API, JSON, XML - Integrate with Power BI, Tableau, QlikView, QlikSense, Informatica PowerCenter, Excel, SQL Server, SSIS, SSAS, SSRS, Visual Studio / WinForm / WCF, Python, C#, VB.net, PHP. PowerShell " width="750" height="372" />
<table style="valign: top;">
<tbody>
<tr>
<td>
<p style="text-align: center;"><strong>BI / Reporting Tools
Integration</strong></p>
</td>
<td style="text-align: center;"><strong>ETL Tools
Integration
</strong></td>
<td style="text-align: center;"><strong>Programming Languages</strong>
<strong>Integration</strong></td>
</tr>
<tr>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">Microsoft Power BI</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/">Tableau</a></li>
 	<li><a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/" target="_blank" rel="noopener">SSRS (SQL Reporting Services)</a></li>
 	<li><a href="https://zappysys.com/blog/qlik-rest-connector-examples-read-json-xml-api/" target="_blank" rel="noopener">QlikView /Qlik Sense</a></li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-in-microstrategy-json-soap-xml/" target="_blank" rel="noopener">MicroStrategy</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-google-sheet-call-appscript-load-json-soap-xml-csv/" target="_blank" rel="noopener">Google Sheet</a></li>
 	<li><a href="https://zappysys.com/blog/import-json-excel-load-file-rest-api/" target="_blank" rel="noopener">Microsoft Excel</a></li>
 	<li><a href="https://zappysys.com/api/integration-hub/rest-api-connector/access?context=connector" target="_blank" rel="noopener">Microsoft Access</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">Informatica PowerCenter</a> (Windows)</li>
 	<li>Informatica Cloud</li>
 	<li>SSIS (SQL Integration Services)</li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">SQL Server</a></li>
 	<li><a href="https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/" target="_blank" rel="noopener">Talend Data Studio</a></li>
 	<li><a href="https://zappysys.com/blog/pentaho-read-rest-api-in-pentaho/" target="_blank" rel="noopener">Pentaho Kettle</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li>Visual Studio</li>
 	<li><a href="https://zappysys.com/blog/calling-rest-api-in-c/" target="_blank" rel="noopener">C#</a></li>
 	<li>C++</li>
 	<li><a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">JAVA</a></li>
 	<li><a href="https://zappysys.com/blog/set-rest-python-client/" target="_blank" rel="noopener">Python</a></li>
 	<li>PHP</li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-powershell-script-export-json-csv/" target="_blank" rel="noopener">PowerShell</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">T-SQL (Using Linked Server)</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
&nbsp;</div>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>In this article we explored many ideas of JSON / API integration in SQL Server.  We saw how to create OAuth App for Google API and import Google Analytics data into SQL Server Table without doing any ETL using pure T-SQL code (Query / Views /Stored Procs). You can <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">Download  FREE Trial of ODBC PowerPack</a> and try yourself see how easy it is to query any API inside SQL Server and avoid expensive ETL processes.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/">Import Google Analytics data into SQL Server / Reporting / ETL</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read JIRA data in SSRS Reports (SQL Server Reporting Services)</title>
		<link>https://zappysys.com/blog/read-jira-data-in-ssrs-reports/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 27 Dec 2018 13:04:45 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[Reporting - Microsoft SSRS]]></category>
		<category><![CDATA[jira]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[odbc json driver]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[SQL Server Reporting Services]]></category>
		<category><![CDATA[ssrs]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5759</guid>

					<description><![CDATA[<p>Introduction In our previous blog we saw how to read rest api in SSRS reports. We recommend you go through that article first. In this post we will look at specific example on How to read JIRA data in SSRS Reports (SQL Server Reporting Services), along with few other topics such as how to generate an [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-jira-data-in-ssrs-reports/">Read JIRA data in SSRS Reports (SQL Server Reporting Services)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Introduction">Introduction</span></h2>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/jira-connector/odbc">API Connector for Jira Online</a> which makes it much simpler to <strong>Read/Write Jira Data in ODBC</strong> compared to the steps listed in this article. You can still use steps from this article but if you are new to API or want to avoid learning curve with API then use newer approach.</p>
<p>Please visit <a href="https://zappysys.com/api/integration-hub/">this page to see all</a> Pre-Configured ready to use API connectors which you can use in <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source</a> / <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-destination/">SSIS API Destination</a> OR <a href="https://zappysys.com/products/odbc-powerpack/odbc-api-driver/">API ODBC Driver</a> (for non-SSIS Apps such as Excel, Power BI, Informatica).</p>
</div></div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/jira-to-ssrs.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignleft wp-image-5762 size-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/12/jira-to-ssrs-150x150.png" alt="jira-to-ssrs" width="150" height="150" /></a>In our previous blog we saw how to <a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/" target="_blank" rel="noopener">read rest api in SSRS reports</a>. We recommend you go through that article first. In this post we will look at specific example on <strong>How to read JIRA data in SSRS Reports (SQL Server Reporting Services)</strong>, along with few other topics such as how to generate an API Token using Atlassian Account for <strong>JIRA REST API Call</strong>, how to read all Issues data from JIRA using our ODBC Driver and load it into the SSRS reports.</p>
<p>We will go through the steps to read data from JIRA and Load into SQL Server using <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">JSON Driver of ODBC PowerPack</a></p>
<p>In nutshell, this post will focus on how to call JIRA API using ODBC PowerPack and how to create SSRS Report.</p>
<p>So let’s get started.</p>
<h2><span id="Requirements">Requirements</span></h2>
<ol>
<li>Make sure you have SSRS designer installed (You can download <a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017" target="_blank" rel="noopener">SSDT BI for Visual Studio</a>).</li>
<li>Finally, make sure to have <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> installed.</li>
</ol>
<h2>What is JIRA</h2>
<p>JIRA is Atlassian’s popular project- and issue-tracking platform used by development and technical support teams to get more work done and faster.</p>
<p>It combines:</p>
<p><strong>issue tracking</strong> &#8211; a software application that allows to record and follow the progress of every problem or &#8220;issue&#8221; that user identifies until the problem is resolved.<br />
<strong>agile project management</strong> &#8211; an iterative approach to planning and guiding project processes. customizable workflow, and a pluggable integration &#8211; integrates with Freshdesk, GitHub, Zendesk, Zapbook, Asana and so on.</p>
<h2>Getting Started</h2>
<p>First of all, we will see several examples. ZappySys includes an <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON Source Connector</a> that will help you to call JIRA API, read various data from JIRA with SSIS and do many more actions using REST API. To learn more about JIRA API <a href="https://developer.atlassian.com/cloud/jira/platform/rest/" target="_blank" rel="noopener">check this help file</a>.</p>
<div class="content_block" id="custom_post_widget-4816"><h2>Generate API Token</h2>
To access JIRA data using REST API call you need to generate an API Token in your Atlassian account. Follow the steps mentioned below to generate API Token:
<ol>
 	<li>you can directly login to the <a href="https://id.atlassian.com" target="_blank" rel="noopener">JIRA Atlassian Cloud site</a> with your credentials, and redirect to the <a href="https://id.atlassian.com/profile/profile.action" target="_blank" rel="noopener">JIRA Atlassian Cloud Account's Profile Page</a> for generating an API Token.</li>
 	<li>Click <strong>API tokens</strong>, then <strong>Create API token</strong>.
<div class="wp-caption aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-4315 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1.png" alt="Generate API Token - Step - 1" width="1600" height="605" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1.png 1600w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1-768x290.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-1-1024x387.png 1024w" sizes="(max-width: 1600px) 100vw, 1600px" /></a>
<p class="wp-caption-text">Generate API Token - Step - 1</p>

</div></li>
 	<li>Create API Token - Give Label name to your API token which you are generating now
<div class="wp-caption aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-4316" src="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2.png" alt="Generate API Token - Step - 2" width="1599" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2.png 1599w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2-768x290.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-2-1024x386.png 1024w" sizes="(max-width: 1599px) 100vw, 1599px" /></a>
<p class="wp-caption-text">Generate API Token - Step - 2</p>

</div></li>
 	<li>Use <strong>Copy to the clipboard</strong>, and paste the token into your or elsewhere:
<div class="su-note-inner su-clearfix" style="background-color:#fff4b7;border-color:#fffdf1;color:#333333"><blockquote>Note:  * For security reasons it isn't possible to view the token after closing the creation dialog; if necessary, create a new token. * You should store the token securely, just as for any password.</blockquote></div>
<div class="wp-caption aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-4321" src="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3.png" alt="Generate API Token - Step - 3" width="1600" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3.png 1600w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3-768x289.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-3-1024x385.png 1024w" sizes="(max-width: 1600px) 100vw, 1600px" /></a>
<p class="wp-caption-text">Generate API Token - Step - 3</p>

</div></li>
 	<li>If you forgot API token, then you can Revoke your old API token and create new API token OR you can create multiple API tokens too.
<div class="wp-caption aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-4326 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4.png" alt="Generate API token - Step - 4" width="1600" height="601" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4.png 1600w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4-300x113.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4-768x288.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/jira-generate-api-token-step-4-1024x385.png 1024w" sizes="(max-width: 1600px) 100vw, 1600px" /></a>
<p class="wp-caption-text">Generate API token - Step - 4</p>

</div></li>
</ol>
Now we have successfully generated an API token. Let´s start with an example. In this example, we will show how to read Tasks/Issues data from JIRA and store that data into a SQL table with SSIS.</div>
<div class="content_block" id="custom_post_widget-8950"><h2>About JIRA REST API</h2>
JIRA On-premises and Cloud Version both offers REST API. Here are some examples of <a href="https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/" target="_blank" rel="noopener">JIRA REST API</a>. For reading JIRA REST API data we will use <a href="https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-query-issues-6291606/" target="_blank" rel="noopener">JIRA REST API Search method</a> which returns data in JSON format. Search API support use of <a href="https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-query-issues-6291606/" target="_blank" rel="noopener">JQL Syntax</a> to filter issues. If you don't specify <strong>JQL</strong> parameters in /search endpoint then all issues will be returned. Check this link to learn <a href="https://www.youtube.com/watch?v=oSxBnqdF3-A" target="_blank" rel="noopener">how to build JQL for JIRA REST API Call</a>. If you don't have JIRA hosted instance yet but still want to try REST API Examples on public JIRA Server then try below URL (Its official JIRA site which lists their own issues). For example, try to copy below URL in a browser and hit enter.
<pre class="">https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER</pre>
<h2><span id="Step-by-Step_Import_REST_API_into_Power_BI">Step-by-Step: Import JIRA data using REST API </span></h2>
Now once you have API token in the JIRA Atlassian Cloud website we can move to ODBC JSON Driver Configuration Part. For this example purpose you can use the following URL:
<pre class="lang:default decode:true">https://YOUR-DOMAIN.atlassian.net/rest/api/2/search?startAt=0&amp;maxResults=100&amp;jql=project=MYPROJECT</pre>
hence, <strong>your-domain is your Atlassian Cloud account’s domain name (we are using zappysys2.atlassian.net).</strong>
Therefore <strong>startAt</strong> is the index of the first item returned in the page of results.
And another<strong> maxResults</strong> is the maximum number of items that can be returned per page.

Above all, each API endpoint may have a different limit for the number of items returned, and these limits may change without notice. (For more See this <a href="https://developer.atlassian.com/cloud/jira/platform/rest/#pagination" target="_blank" rel="noopener">JIRA API Documentation for Pagination</a>)
<h2><span id="Configure_Data_Source_in_Gateway_ZappySys_JSON_REST_API_Driver_Example">Configure Data Source in Gateway (ZappySys JSON / REST API Driver Example)</span></h2>
Now let's look at how to configure <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a>. This feature acts as a bridge between Client App and ZappySys Drivers. Using data gateway you can use ZappySys Drivers inside applications / operating systems where ZappySys drivers may not be available directly for some reason (e.g. You don't have access to Server for Installation or System does not support ODBC drivers like JAVA programs). <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-gateway/">Click here to read more</a> on various use cases of Data Gateway.
<h3><span style="font-size: 14pt;">Configure Data Gateway User / Port</span></h3>
Now let's look at steps to configure Data Gateway after installation. We will also create a sample data source for ODATA API (i.e. JSON based REST API Service).
<ol>
 	<li>Assuming you have installed <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> using default options (Which also enables Data Gateway Service)</li>
 	<li>Search "Gateway" in your start menu and click ZappySys Data Gateway
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Open ZappySys Data Gateway</p>

</div></li>
 	<li>First make sure Gateway Service is running (Verify Start icon is disabled)</li>
 	<li>Also verify Port on General Tab
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-data-gateway-port-5000.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-data-gateway-port-5000.png" alt="Port Number setting on ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Port Number setting on ZappySys Data Gateway</p>

</div></li>
 	<li>Now go to Users tab. <strong>Click Add</strong> icon to add a new user. Check Is admin to give access to all data sources you add in future. If you don't check admin then you have to manually configure user permission for each data source.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png" alt="Add Data Gateway User" /></a>
<p class="wp-caption-text">Add Data Gateway User</p>

</div></li>
</ol>
&nbsp;
<h4><span style="font-size: 14pt;">Configure Data Source</span></h4>
<ol>
 	<li>After user is added, go to Data Sources tab. <strong>Click Add</strong> icon to create new data source. Select appropriate driver based on your API / File format. You can choose Generic ODBC option to read data from ODBC DSN or use Native Driver option.
<pre class=""><strong>NOTE:</strong> Whenever possible use native driver option for better performance / security and ease of use.</pre>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png" alt="Add Gateway Data Source (Native JSON Driver)" /></a>
<p class="wp-caption-text">Add Gateway Data Source (Native JSON Driver)</p>

</div></li>
 	<li>Now it's time to connect with JIRA. Let's use JSON Driver Data source with the following URL. Change domain with your own domain.
<div id="crayon-5befbb0bdc2d5563302218" class="crayon-syntax crayon-theme-vs2012 crayon-font-courier-new crayon-os-pc print-yes notranslate">
<div class="crayon-main">
<pre class="lang:default decode:true" style="padding-left: 30px;">https://{yourdomain}.atlassian.net/rest/api/2/search?startAt=0&amp;maxResults=100
</pre>
</div>
</div>
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5390" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url.png" alt="ODBC JSON Driver: Enter Request URL" width="802" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_enter_jira_request_url-768x672.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></a>

ODBC JSON Driver: Enter Request URL

</div></li>
 	<li>It is time to configure the Other Settings. Select HTTP Connection Type from the Connection Type drop-down and Click on Click to Configure Link to Configure the Connection Manager.
<div class="wp-caption alignnone">

[caption id="attachment_5596" align="alignnone" width="1245"]<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/jira-odbc-json-driver-configure-http-api-connection-e1548714720542.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-5596 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/11/jira-odbc-json-driver-configure-http-api-connection-e1548714720542.png" alt="JIRA REST API Connection - Use ZappySys JSON Driver HTTP Connection" width="1245" height="695" /></a> JIRA REST API Connection - Use ZappySys JSON Driver HTTP Connection[/caption]

JIRA REST API Connection - Use ZappySys JSON Driver HTTP Connection

</div></li>
 	<li>Now, we are going to set Pagination related configurations for JIRA Search request. Page number indicator must be <span class="crayon-syntax crayon-syntax-inline crayon-theme-vs2012 crayon-theme-vs2012-inline crayon-font-courier-new" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-pre crayon-code" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-v">startAt</span></span></span> and <span class="crayon-syntax crayon-syntax-inline crayon-theme-vs2012 crayon-theme-vs2012-inline crayon-font-courier-new" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-pre crayon-code" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-v">maxResults</span></span></span> value in URL must match with Increment By (i.e. 100)
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_pagination_configurations.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5392" src="https://zappysys.com/blog/wp-content/uploads/2018/12/odbc_json_driver_pagination_configuration.png" alt="ODBC JSON Driver - JIRA request Pagination Configurations Settings" width="802" height="702" /></a>

ODBC JSON Driver - JIRA request Pagination Configurations Settings

</div></li>
 	<li>After adding pagination parameters let's add <span id="crayon-5c2b1cd384d9b365821121" class="crayon-syntax crayon-syntax-inline crayon-theme-vs2012 crayon-theme-vs2012-inline crayon-font-courier-new" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-pre crayon-code" style="font-size: 12px !important; line-height: 15px !important;"><span class="crayon-v">JQL</span><span class="crayon-o">=</span></span></span> search parameter to get specific data. Here we are searching the data by Project name and status. You can find more information about JQL on this link: <a href="https://confluence.atlassian.com/jiracore/blog/2015/07/search-jira-like-a-boss-with-jql" target="_blank" rel="noopener">Search JIRA like a boss with JQL</a>
Here is example JQL search query for Public JIRA site. Replace jira.atlassian.com and project JRASERVER with your own values.
<pre class="lang:default highlight:0 decode:true">https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER
https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER AND status=Open
https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER AND status in (Open,Done)
https://jira.atlassian.com/rest/api/2/search?jql=project=JRASERVER AND status=Open order by lastViewed DESC</pre>
<div id="attachment_5829" align="aligncenter">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-5830 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql-768x672.png" alt="Search using jql parameter" width="720" height="630" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql-768x672.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/jira-search-using-jql.png 802w" sizes="(max-width: 720px) 100vw, 720px" /></a>

Search using JQL parameter

</div></li>
 	<li>Click on Select Filter to set the Filter.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5393" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter.png" alt="ODBC JSON Driver for JIRA API: Select Filter" width="1283" height="699" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter.png 1283w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter-300x163.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter-768x418.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_select_filter-1024x558.png 1024w" sizes="(max-width: 1283px) 100vw, 1283px" /></a>

ODBC JSON Driver for JIRA API: Select Filter

</div></li>
 	<li>You are done with the Configurations, Click on Test Connection to test the Connection.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5394" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection.png" alt="ODBC JSON Driver - Test Connection" width="802" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_test_connection-768x672.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></a>

ODBC JSON Driver - Test Connection

</div></li>
 	<li>After that select the table from where you want to get data.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_create_query_of_json.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-5396" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_create_query_of_json.png" alt="JSON Driver: Create Query of JSON data" width="749" height="434" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_create_query_of_json.png 749w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_create_query_of_json-300x174.png 300w" sizes="(max-width: 749px) 100vw, 749px" /></a>

JSON Driver: Create Query of JSON data

</div></li>
 	<li>Click on the Preview Data button to preview the data.
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-5553 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data.png" alt="Preview issues table data" width="1016" height="734" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data.png 1016w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data-300x217.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/odbc_json_driver_preview_data-768x555.png 768w" sizes="(max-width: 1016px) 100vw, 1016px" /></a>

Preview issues table data

</div></li>
 	<li>And that’s it, Now we will move forward to the next Phase.</li>
</ol>
<h3>Build your Own JQL Search queries for JIRA Issue</h3>
In previous sections we saw some basic JQL queries to search JIRA Issues using API call. Now lets look at how to build such queries using online UI (Think like a query builder). from JIRA.
<ol>
 	<li>JIRA has its own public Issue repository which you can browse any time by going here <a href="https://jira.atlassian.com/issues/" target="_blank" rel="noopener">https://jira.atlassian.com/issues/</a></li>
 	<li>Now try to change filter settings for search criteria (E.g. change Project, Status etc)</li>
 	<li>You will notice when you make change your URL keeps changing too. From that URL you can extract ?jql=xxxxxxx  part and use it as template for your own JIRA API search queries.</li>
</ol>
For more information check <a href="https://www.youtube.com/watch?v=oSxBnqdF3-A" target="_blank" rel="noopener">how to build JQL for JIRA REST API Call</a>.</div>
<h3>Create and configure new SSRS Reports (Using ODBC Connection)</h3>
<p>Let&#8217;s create a new SSRS project.</p>
<ol>
<li>In SSRS, in a new Reporting Service Project, add a new Data Source:
<div id="attachment_3219" style="width: 585px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-data-source.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3219" class="wp-image-3219 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-data-source.jpg" alt="Add REST data source in SSRS" width="575" height="207" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-data-source.jpg 575w, https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-data-source-300x108.jpg 300w" sizes="(max-width: 575px) 100vw, 575px" /></a><p id="caption-attachment-3219" class="wp-caption-text">Add SSRS data source</p></div></li>
<li>Also, specify a name for the data source and in type select ODBC. Press Edit to select the ODBC connection for JSON and REST API and select the ZappySys Data Source name that we created before.
<div id="attachment_5760" style="width: 1209px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/add-ssrs-json-data-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5760" class="wp-image-5760 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/add-ssrs-json-data-source.png" alt="Add ODBC JSON Data Source" width="1199" height="551" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/add-ssrs-json-data-source.png 1199w, https://zappysys.com/blog/wp-content/uploads/2018/12/add-ssrs-json-data-source-300x138.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/add-ssrs-json-data-source-768x353.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/add-ssrs-json-data-source-1024x471.png 1024w" sizes="(max-width: 1199px) 100vw, 1199px" /></a><p id="caption-attachment-5760" class="wp-caption-text">Add ODBC JSON Data Source</p></div></li>
<li>Now let’s create a new SSRS report which uses the API data source we created in the previous section.</li>
<li>Right-click on the Reports node and click Add New Report (Wizard mode)
<div id="attachment_3228" style="width: 446px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-add-new-json-report.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3228" class="wp-image-3228 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-add-new-json-report.jpg" alt="Add report" width="436" height="271" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-add-new-json-report.jpg 436w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-add-new-json-report-300x186.jpg 300w" sizes="(max-width: 436px) 100vw, 436px" /></a><p id="caption-attachment-3228" class="wp-caption-text">Add new SSRS report</p></div>
<p>&nbsp;</li>
<li>In New report, wizard window clicks on next button until you reach the step of query builder like below screen. Now Press the query builder button.<div class="su-note"  style="border-color:#e5da9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff4b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Note: You can also copy and paste the query directly into the Query string box which we created in the previous phase.</p><pre class="crayon-plain-tag">SELECT * FROM "issues"</pre><p>
</div></div>
<div id="attachment_3230" style="width: 735px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-query-builder.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3230" class="wp-image-3230 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-query-builder.jpg" alt="Create query from REST API" width="725" height="521" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-query-builder.jpg 725w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-query-builder-300x216.jpg 300w" sizes="(max-width: 725px) 100vw, 725px" /></a><p id="caption-attachment-3230" class="wp-caption-text">Query builder</p></div></li>
<li>Now, press the Add table icon and go to Views. Select issues(DATA) and press Add.
<div id="attachment_5781" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-add-table.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5781" class="wp-image-5781 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-add-table-768x572.png" alt="ssrs-add-table" width="720" height="536" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-add-table-768x572.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-add-table-300x223.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-add-table.png 917w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-5781" class="wp-caption-text">SSRS Add Table</p></div></li>
<li>Now remove <strong>DATA.</strong> prefix from the query so that our query look&#8217;s like as below and Click Ok button:<br />
<pre class="crayon-plain-tag">SELECT issues.* FROM issues</pre>
</li>
<li>Now press Next Button and select <strong>Tabular</strong> Report Type and go to next in the following option until the completing wizard and specify a name for the report and finally press the <strong>Finish</strong> button.</li>
<li>Now click on the Preview a report. It shows the report and exports the REST API data to Word, Excel, PowerPoint, etc:
<div id="attachment_5784" style="width: 750px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-preview-report-issues-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5784" class="wp-image-5784 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-preview-report-issues-1.png" alt="SSRS Preview a Report" width="740" height="578" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-preview-report-issues-1.png 740w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssrs-preview-report-issues-1-300x234.png 300w" sizes="(max-width: 740px) 100vw, 740px" /></a><p id="caption-attachment-5784" class="wp-caption-text">SSRS Preview a Report</p></div></li>
<li>That’s all we have successfully imported the JIRA data in SSRS Reports (SQL Server Reporting Services).</li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this blog, we have learned how to retrieve the data from JIRA using ODBC JSON Driver and then generated the SSRS Reports using those data with ODBC DSN in a very simple way. You can achieve many more functionalities with the use of <a href="https://zappysys.com/products/odbc-powerpack/">ODBC PowerPack</a>.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information about the use of JIRA API with our tools:</p>
<ul>
<li><a href="https://developer.atlassian.com/cloud/jira/platform/rest/" target="_blank" rel="noopener">JIRA Documentation for API</a></li>
<li><strong>Landing Page</strong> for <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">ODBC JSON / REST API Driver</a>, you can also find <a href="https://youtu.be/iwezz0Z3D4U" target="_blank" rel="noopener">Tutorial Video</a> here.</li>
<li><strong>Help File:</strong> Documentation of <a href="https://zappysys.com/onlinehelp/odbc-powerpack/index.htm#page=json-odbc-driver-intro.htm" target="_blank" rel="noopener">JSON Driver</a>.</li>
<li><strong>Blog/articles link</strong>: <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-drivers/json-rest-api-driver/" target="_blank" rel="noopener">https://zappysys.com/blog/category/odbc-powerpack/odbc-drivers/json-rest-api-driver/</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-jira-data-in-ssrs-reports/">Read JIRA data in SSRS Reports (SQL Server Reporting Services)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Calling SSRS Reports in SSIS (Export / Email)</title>
		<link>https://zappysys.com/blog/calling-ssrs-reports-in-ssis-export-emai/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Sat, 16 Jun 2018 20:07:59 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[SSIS Report Generator (SSRS)]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssrs]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4008</guid>

					<description><![CDATA[<p>Introduction about calling SSRS Reports in SSIS Calling SSRS Reports in SSIS is straightforward using the ZappySys Reporting Services task. Also, we will show how to export files SSRS files using SSIS, how to send reports in emails and how to send parameters. In addition, we will be using this ZappySys SSIS PowerPack component to make things work: [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/calling-ssrs-reports-in-ssis-export-emai/">Calling SSRS Reports in SSIS (Export / Email)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction about calling SSRS Reports in SSIS</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/reporting-services-logo.png"><img loading="lazy" decoding="async" class=" wp-image-4022 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/reporting-services-logo.png" alt="Logo of Reporting Services" width="93" height="93" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/reporting-services-logo.png 260w, https://zappysys.com/blog/wp-content/uploads/2018/06/reporting-services-logo-150x150.png 150w" sizes="(max-width: 93px) 100vw, 93px" /></a>Calling SSRS Reports in SSIS is straightforward using the ZappySys Reporting Services task. Also, we will show how to export files SSRS files using SSIS, how to send reports in emails and how to send parameters.</p>
<p>In addition, we will be using this <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> component to make things work:<br />
<div class="su-table su-table-alternate">
<table width="300">
<tbody>
<tr style="line-height: 0px">
<td width="50px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-report-generator-task/" target="_blank" rel="noopener"><br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3074" src="https://zappysys.com/images/SSIS-PowerPack/SSIS-SSRS-Reporting-Services-Task.png" alt="SSIS Report Generator Task (Export SSRS Reports) " width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="https://zappysys.com/products/ssis-powerpack/ssis-report-generator-task/" target="_blank" rel="noopener">SSIS Report Generator Task (Export SSRS Reports)<br />
</a></td>
</tr>
<tr style="line-height: 0px">
<td style="height: 58px" width="50px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener"><br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3074" src="https://zappysys.com/images/SSIS-PowerPack/ssis-file-system-task-advanced.png" alt="Advanced SSIS File System Task" width="50" height="50" /></a></td>
<td style="vertical-align: middle;height: 58px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener">Advanced SSIS File System Task</a></td>
</tr>
</tbody>
</table>
</div>
<p>In order to understand the functionality, the following video tutorial can be useful to understand the functionality of this useful Reporting Services task:<br />
[youtube https://www.youtube.com/watch?v=ajnSgbXls7I&amp;w=560&amp;h=315]
<h2>Requirements</h2>
<ol>
<li>First of all, we will need ZappySys SSIS PowerPack. This tool contains the Reporting Services Task.</li>
<li>Secondly, you will require SSDT for Business Intelligence to create SSIS projects.</li>
<li>Also, make sure to have an SSRS report deployed. For more information<br />
about creating reports and deploying, refer to these links:</li>
</ol>
<ul>
<li style="list-style-type: none;">
<ul>
<li><a href="https://docs.microsoft.com/en-us/sql/reporting-services/create-a-basic-table-report-ssrs-tutorial?view=sql-server-2017" target="_blank" rel="noopener">Create a Basic Table Report (SSRS Tutorial)</a></li>
<li><a href="https://docs.microsoft.com/en-us/sql/reporting-services/reports/publishing-reports-to-a-report-server?view=sql-server-2017" target="_blank" rel="noopener">Publishing Reports to a Report Server</a></li>
</ul>
</li>
</ul>
<h2>Getting started</h2>
<p>We will first show how to export an SSRS Report to Word format (docx). Also, the ZappySys SSIS PowerPack, allows converting your SSRS reports deployed into Word (docx and doc), Excel (xlsx and xls), PDF, TIFF, CSV and XML.</p>
<h3>Calling SSRS Reports in SSIS</h3>
<ol>
<li>First of all drag and drop the ZS Reporting Task that is included with our ZappySys SSIS PowerPack:
<div id="attachment_4025" style="width: 624px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Reporting-Service-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4025" class="size-full wp-image-4025" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Reporting-Service-task.png" alt="Task to convert SSRS report into files" width="614" height="433" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Reporting-Service-task.png 614w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Reporting-Service-task-300x212.png 300w" sizes="(max-width: 614px) 100vw, 614px" /></a><p id="caption-attachment-4025" class="wp-caption-text">SSRS task in SSIS</p></div></li>
<li>Secondly, in general tab, make sure that the Export server report is enabled.</li>
<li>Additionally, specify the report service URL. If you are not sure what is your report service URL, check the step 3 in requirements.</li>
<li>In addition, in report path, select the report that you want to export to a file.</li>
<li>Also, check the output as a file option:
<div id="attachment_4026" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-export-report-to-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4026" class="size-full wp-image-4026" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-export-report-to-file.png" alt="Configurations to export files" width="625" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-export-report-to-file.png 625w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-export-report-to-file-300x289.png 300w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-4026" class="wp-caption-text">Export report to file</p></div></li>
<li>Additionally, in the export settings tab, go to Save as and specify the path and extension of the file to export. You can export to Excel, Word, PDF, Tiff, CSV and XML:
<div id="attachment_4042" style="width: 636px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-export-report-server-PDF-DOCX-XLSX.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4042" class="size-full wp-image-4042" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-export-report-server-PDF-DOCX-XLSX.png" alt="Reporting Services to Excel Word PDF" width="626" height="615" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-export-report-server-PDF-DOCX-XLSX.png 626w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-export-report-server-PDF-DOCX-XLSX-300x295.png 300w" sizes="(max-width: 626px) 100vw, 626px" /></a><p id="caption-attachment-4042" class="wp-caption-text">Export SSRS report using SSIS to Excel, Word, PDF</p></div></li>
<li>Finally, run the package and the file will be created:
<div id="attachment_4044" style="width: 373px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-report-in-word.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4044" class="size-full wp-image-4044" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-report-in-word.png" alt="Calling SSRS Reports in SSIS to export to MS Word " width="363" height="225" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-report-in-word.png 363w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-report-in-word-300x186.png 300w" sizes="(max-width: 363px) 100vw, 363px" /></a><p id="caption-attachment-4044" class="wp-caption-text">SSRS report exported to docx</p></div></li>
</ol>
<h3>Changing the names of the reports with the date format</h3>
<p>In order to explain how to add the prefix or suffix of a file with the current date. For example, I want my SSRS reports with this format:<br />
Filename20180323.xlsx where 20180323 means march 23, 2018. To understand how to do it, In this new example, we will show how to do it.</p>
<ol>
<li>First of all, we will use the ZappySys Advanced File System Task:</li>
<li>Secondly, we will use the option Rename files and rename using the fun_getdate function like this: <strong><strong><strong>Filename&lt;&lt;yyyy-MM-dd,FUN_GETDATE&gt;&gt;.xlsx</strong></strong></strong>
<div id="attachment_4051" style="width: 693px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-rename-a-file-with-current-date.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4051" class="size-full wp-image-4051" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-rename-a-file-with-current-date.png" alt="SSIS Rename files with date" width="683" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-rename-a-file-with-current-date.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-rename-a-file-with-current-date-300x278.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-4051" class="wp-caption-text">Rename the file with a date in SSIS</p></div></li>
<li>Also, you can watch all the available examples of functions by pressing the Expressions (x) button:
<div id="attachment_4057" style="width: 690px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-functions-for-dates.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4057" class="size-full wp-image-4057" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-functions-for-dates.png" alt="Functions in SSIS " width="680" height="629" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-functions-for-dates.png 680w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-functions-for-dates-300x278.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-4057" class="wp-caption-text">Special SSIS functions</p></div></li>
<li>Finally, press insert variable and function examples and you will be able to see all the examples of special functions to simplify your life:
<div id="attachment_4058" style="width: 916px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4058" class="size-full wp-image-4058" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates.png" alt="Special functions" width="906" height="732" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates.png 906w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates-300x242.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates-768x621.png 768w" sizes="(max-width: 906px) 100vw, 906px" /></a><p id="caption-attachment-4058" class="wp-caption-text">Samples of functions</p></div></li>
</ol>
<h3>Moving your report files to a UNC path</h3>
<p>Once that you have your files exported from reporting services to a file, you can move, copy them to another path. In this example, we will show how to move files to a Shared folder using a UNC path.</p>
<ol>
<li> First of all, specify your file name to move. You can use *.xml for example to move all the files.</li>
<li>Secondly, specify the UNC path in destination:
<div id="attachment_4059" style="width: 693px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-move-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4059" class="size-full wp-image-4059" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-move-files.png" alt="Move SSRS reports exported to UNC path" width="683" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-move-files.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-move-files-300x278.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-4059" class="wp-caption-text">SSIS move files to UNC path</p></div></li>
<li>Also, It is possible to sort files by name, size, modified date or other properties:
<div id="attachment_4061" style="width: 693px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-move-files-sorted-by-name-modified-date.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4061" class="size-full wp-image-4061" src="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-move-files-sorted-by-name-modified-date.png" alt="SSIS Sorting files by properties" width="683" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-move-files-sorted-by-name-modified-date.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-move-files-sorted-by-name-modified-date-300x278.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-4061" class="wp-caption-text">Sort file in SSIS by name, size, modified date</p></div></li>
<li>Finally, press the Examples link, you can see some custom queries that you can create:
<div id="attachment_4062" style="width: 572px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-filter-file-properties.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4062" class="size-full wp-image-4062" src="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-filter-file-properties.png" alt="SSIS queries to get file information" width="562" height="397" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-filter-file-properties.png 562w, https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-filter-file-properties-300x212.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></a><p id="caption-attachment-4062" class="wp-caption-text">Sample SSIS queries to files</p></div></li>
</ol>
<h3>Sending SSRS Report as an attachment in an email</h3>
<p>The task also allows calling SSRS reports in SSIS and send the reports to an email. To do it, it is necessary to have an SMTP Server. Let&#8217;s take a look at the steps:</p>
<ol>
<li>First of all, in the general tab, check the email report file and uncheck the Output as file option:
<div id="attachment_4064" style="width: 637px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-email-SSRS-Reporting-Service.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4064" class="size-full wp-image-4064" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-email-SSRS-Reporting-Service.png" alt="Send SSRS report as attachment in SSIS" width="627" height="616" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-email-SSRS-Reporting-Service.png 627w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-email-SSRS-Reporting-Service-300x295.png 300w" sizes="(max-width: 627px) 100vw, 627px" /></a><p id="caption-attachment-4064" class="wp-caption-text">Output SSRS report in SSIS as attachment</p></div></li>
<li>Also, in Email setting tab, press New in SMTP connections to create a new connection. You will need to provide an SMTP server name, an email and a password. It is also necessary to enter the port. You can find the list of some SMTP servers and ports <a href="https://www.arclab.com/en/kb/email/list-of-smtp-and-pop3-servers-mailserver-list.html" target="_blank" rel="noopener">here</a>.</li>
<li>In addition, you have an option to specify the sender, receiver, subject, and body. It is possible to write the body in HTML format. You can also specify SSIS variables. The following HTML code shows how to write in bold,<br />
italic, with bullets and more:<br />
<pre class="crayon-plain-tag">&lt;h1&gt;This is an example using headers&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;This is an example to write using bold&lt;/strong&gt; &lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;em&gt;This is an example to write using italic &lt;br /&gt;&lt;/em&gt;
This is an example using underline&lt;br /&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;This is an example with lists&lt;/li&gt;
  &lt;li&gt;Sedond of the list&lt;/li&gt;
  &lt;li&gt;Third of the list&lt;/li&gt;
&lt;/ol&gt;
&lt;ul style="list-style-type:circle"&gt;
  &lt;li&gt;This is an example with bullets&lt;/li&gt;
  &lt;li&gt;Bullet sample &lt;/li&gt;
  &lt;li&gt;Working with bullets&lt;/li&gt;
&lt;/ul&gt;</pre>
&nbsp;</p>
<div id="attachment_4075" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-send-report-as-email-attachment.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4075" class="size-full wp-image-4075" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-send-report-as-email-attachment.png" alt="SSIS HTML mail message" width="625" height="665" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-send-report-as-email-attachment.png 625w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-send-report-as-email-attachment-282x300.png 282w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-4075" class="wp-caption-text">Dynamic HTML in SSIS</p></div></li>
<li>Additionally, in Visual Studio go to the menu and SSIS, Variables and create two variables that will be used in the report named Title and ReportName of type string and specify values for them:
<div id="attachment_4066" style="width: 727px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-variables.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4066" class="size-full wp-image-4066" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-variables.png" alt="SSIS dynamic emails" width="717" height="142" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-variables.png 717w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-variables-300x59.png 300w" sizes="(max-width: 717px) 100vw, 717px" /></a><p id="caption-attachment-4066" class="wp-caption-text">Using SSIS variables in emails</p></div></li>
<li>Finally, run the script and check your email received:
<div id="attachment_4077" style="width: 610px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-SSIS-email-sent.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4077" class="size-full wp-image-4077" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-SSIS-email-sent.png" alt="The email with the SSRS Report" width="600" height="358" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-SSIS-email-sent.png 600w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-SSIS-email-sent-300x179.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-4077" class="wp-caption-text">Email received SSIS Html format</p></div></li>
</ol>
<h3>Calling SSRS Reports in SSIS with parameters</h3>
<p>Another key point is the use of parameters. Sometimes your SSRS includes parameters. With our Reporting Service Task, it is possible to call an SSRS report and pass SSIS parameters. You will require a Report with a parameter to test it. If you do not know how to create a parameter in SSRS, click <a href="https://docs.microsoft.com/en-us/sql/reporting-services/report-design/report-parameters-report-builder-and-report-designer?view=sql-server-2017" target="_blank" rel="noopener">here</a>.</p>
<ol>
<li>First of all, you will need an SSRS Report with a parameter:
<div id="attachment_4081" style="width: 811px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4081" class="size-full wp-image-4081" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter.png" alt="SSRS reporting with parameters" width="801" height="392" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter.png 801w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter-300x147.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter-768x376.png 768w" sizes="(max-width: 801px) 100vw, 801px" /></a><p id="caption-attachment-4081" class="wp-caption-text">Reporting Service Parameter</p></div></li>
<li>Secondly, in SSDT or Visual Studio, in the menu, go to SSIS and variables. Create an SSIS variable:
<div id="attachment_4082" style="width: 605px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-parameters.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4082" class="size-full wp-image-4082" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-parameters.png" alt="Creating variables in SSIS" width="595" height="109" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-parameters.png 595w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-parameters-300x55.png 300w" sizes="(max-width: 595px) 100vw, 595px" /></a><p id="caption-attachment-4082" class="wp-caption-text">Variables in SSIS</p></div></li>
<li> Finally, in Report Services Task in Visual Studio, go to Report Parameters and map the SSRS parameter with the SSIS variable:
<div id="attachment_4083" style="width: 726px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-map-reporting-service-parameters-with-integration-services-parameters.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4083" class="size-full wp-image-4083" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-map-reporting-service-parameters-with-integration-services-parameters.png" alt="SSIS mapping of SSRS paremeters and SSIS variables" width="716" height="497" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-map-reporting-service-parameters-with-integration-services-parameters.png 716w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-map-reporting-service-parameters-with-integration-services-parameters-300x208.png 300w" sizes="(max-width: 716px) 100vw, 716px" /></a><p id="caption-attachment-4083" class="wp-caption-text">Map SSIS variable with SSRS parameters</p></div></li>
</ol>
<h3>Calling SSRS Reports in SSIS using data-driven configuration</h3>
<p>Data-driven configuration allows configuring different reports with different configurations. In addition, the option allows handling multiple reports using a table with all the configurations for each report. Also, this task creates a table in SQL Server with the configurations for each report. Let&#8217;s take a look to see how this works.</p>
<ol>
<li>First of all, select the data-driving report export using config table.</li>
<li> Also, you will need to specify the connection to the SQL Server<br />
database.</li>
<li>In addition, go to config table, press new to create a new table:
<div id="attachment_4099" style="width: 632px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4099" class="size-full wp-image-4099" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1.png" alt="Data-driven configuration for SSRS in SSIS" width="622" height="618" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1.png 622w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1-300x298.png 300w" sizes="(max-width: 622px) 100vw, 622px" /></a><p id="caption-attachment-4099" class="wp-caption-text">SSRS Data-driven in SSIS</p></div></li>
<li>Additionally, ZappySys allows creating a sample table that can help you to understand how to configure local reports, Calling SSRS Reports in SSIS and save to files, specify paths, ports, email options and more:<br />
<pre class="crayon-plain-tag">CREATE TABLE [{{SchemaName}}].[{{TableName}}](
	Id int identity(1,1) NOT NULL  PRIMARY KEY, 
	GroupName varchar(100) NULL,  /* Used to filter reports */
	ReportType varchar(10) NOT NULL, /*Local or Server*/
	ReportServiceUrl  varchar(500) null, 
	ReportPath varchar(500) NOT NULL, 
	IsEnabled bit NOT NULL default(1),
	ExportAsFile bit NOT NULL default(1),
	ExportAsEmail bit NOT NULL default(0),
	Parameters varchar(max) NULL, /* ParameterName1;IsMultiValue;Value1|....ParameterNameN;IsMultiValue;ValueN */
	ExportPath varchar(500) NULL,
	AddFileSuffix bit NULL,
	ExportFileSuffix varchar(500) NULL, /* e.g. _ddMMyyyy, _ddMMyyyyhhmmss, _ddMMyyyyhhmmss.fff (see this URL http://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx) */
	Description varchar(500) NULL,
	EmailFrom varchar(255) NULL,
	EmailTo varchar(1000) NULL,
	EmailCc varchar(1000) NULL,
	EmailBcc varchar(1000) NULL,
	EmailSubject varchar(500) NULL,	
	EmailIsHtml bit NULL default(1),	
	EmailBodyText varchar(max) NULL,
	EmailAttachmentFile varchar(500) NULL, /*Unused: For future use only*/
	LastExportStartDate datetime NULL,
	LastExportEndDate datetime NULL,
	LastStatus varchar(20) NULL,
	LastMessage varchar(max) NULL,
	Datasets varchar(max) NULL, /*if ReportType=local and report file is using dataset(s) then supply data in this column (multiple values must be pipe delimited). e.g. Dataset1|Dataset2)*/
	DatasetConnectionStrings varchar(max) NULL, /*if ReportType=local and report file is using dataset(s) then supply data in this column (connection string must be same order as datasets (multiple values must be pipe delimited) enter just one connectionstring if all datasets using same connection. ConnectionString must be ADO.NET for SQLServer, ODBC or OLEDB connection string and correct driver must be installed on the system)*/
	DatasetQueries varchar(max) NULL /*if ReportType=local and report file is using dataset(s) then supply data in this column (queries must be in the same order as dataset(s) listed in Datasets column. enter multiple queries in this format &lt;xml&gt;&lt;query&gt;{query for 1st dataset}&lt;/query&gt;&lt;query&gt;{query for 2nd dataset}&lt;/query&gt;&lt;/xml&gt;)*/
);</pre>
&nbsp;</p>
<div id="attachment_4100" style="width: 499px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-data-driven-table-t-sql-code.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4100" class="size-full wp-image-4100" src="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-data-driven-table-t-sql-code.png" alt="Data-driven table in SSRS" width="489" height="332" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-data-driven-table-t-sql-code.png 489w, https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-data-driven-table-t-sql-code-300x204.png 300w" sizes="(max-width: 489px) 100vw, 489px" /></a><p id="caption-attachment-4100" class="wp-caption-text">Sample Database in SSIS for SSRS</p></div></li>
<li>Finally, you can check the table with the configuration:
<div id="attachment_4102" style="width: 849px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4102" class="size-full wp-image-4102" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS.png" alt="SSIS data-driven table in SSRS" width="839" height="137" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS.png 839w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS-300x49.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS-768x125.png 768w" sizes="(max-width: 839px) 100vw, 839px" /></a><p id="caption-attachment-4102" class="wp-caption-text">Data-driven table created in SSIS</p></div></li>
</ol>
<h3>Calling SSRS Reports in SSIS to Export local report option</h3>
<p>With local reports, you can work with rdl files. The rdl (Report Definition Language) files are part of the SSRS. They are physical files that contain the report format and other components. Using the export local report you can customize queries and see the results as reports. Here we will explain how to do it.</p>
<ol>
<li>First of all, in the Reporting Services task in Visual Studio, make sure to select the option Export local report.</li>
<li>Secondly, in report path, you need to specify your rdl file path.</li>
<li>In addition, check the dataset. The dataset is usually detected by default. It is included in the SSRS.</li>
<li>Also, in Dataset Constr, you will need to specify the connection information. You need to specify the SQL Server name, Database name, Authentication type. For more information about connection string, click <a href="https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax" target="_blank" rel="noopener">here</a>.</li>
<li>Finally, in dataset queries, you need to specify your query using the XML and query tags:
<div id="attachment_4103" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Export-local-report-query-dataset-connection-string.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4103" class="size-full wp-image-4103" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Export-local-report-query-dataset-connection-string.png" alt="SSRS report in SSIS" width="625" height="665" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Export-local-report-query-dataset-connection-string.png 625w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Export-local-report-query-dataset-connection-string-282x300.png 282w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-4103" class="wp-caption-text">SSIS local SSRS report</p></div></li>
</ol>
<h2>Conclusion</h2>
<p>In summary, calling SSRS Reports in SSIS is a straightforward task using the ZappySys Reporting Service task. In this article, we learned how to export a Reporting services Report to a file. Also, we learned how to send emails using SSIS with the report attached and we also learned how to rename, copy files and finally how to use Data-Driven configuration and create queries to local reports. If you liked the tool, you can download it <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">here.</a></p>
<h2>References</h2>
<p>Finally, refer to these links for more information:</p>
<ul>
<li><a href="https://docs.microsoft.com/en-us/sql/reporting-services/reporting-services-tutorials-ssrs?view=sql-server-2017" target="_blank" rel="noopener"> Reporting Services Tutorial<br />
</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-report-generator-task/" target="_blank" rel="noopener">SSRS Task in SSIS</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/calling-ssrs-reports-in-ssis-export-emai/">Calling SSRS Reports in SSIS (Export / Email)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read REST API in SSRS Reports (JSON / XML / Call SOAP Web Service)</title>
		<link>https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Thu, 19 Apr 2018 19:39:51 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft SSRS]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[reporting]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[ssrs]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=3209</guid>

					<description><![CDATA[<p>Introduction (Read REST / SOAP API in SSRS) In this tutorial, you will learn how to read REST API in SSRS (SQL Server Reporting Services). Traditionally to read data from XML / JSON Files or RESTful web service in SSRS, some sort of ETL approach was needed (i.e Load data from JSON / XML to SQL [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/">How to read REST API in SSRS Reports (JSON / XML / Call SOAP Web Service)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction (Read REST / SOAP API in SSRS)</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/json-to-sql-server-import-export.png"><img loading="lazy" decoding="async" class=" wp-image-2924 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/03/json-to-sql-server-import-export.png" alt="JSON to SQL Server" width="239" height="227" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/json-to-sql-server-import-export.png 362w, https://zappysys.com/blog/wp-content/uploads/2018/03/json-to-sql-server-import-export-300x284.png 300w" sizes="(max-width: 239px) 100vw, 239px" /></a>In this tutorial, you will learn how to read <strong>REST API in SSRS</strong> (SQL Server Reporting Services). Traditionally to <strong>read data from XML / JSON Files or RESTful web service in SSRS</strong>, some sort of ETL approach was needed (i.e Load data from JSON / XML to SQL server first and then read from SQL Server to SSRS).</p>
<p>This article will focus on very unique and simple approach, we will use  <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys drivers for JSON / XML / REST API</a> to read REST API or JSON Files in SSRS reports. ZappySys JSON driver allows you to query any API source or JSON / XML files using familiar SQL query language.</p>
<p>Example purpose, we will only show JSON file format but the same approach can be used for<strong> reading from XML files</strong> or Calling XML SOAP Web Services in SSRS. We will also learn how to <strong>connect using OAuth to Facebook</strong>. We can also connect to Google, Azure, Facebook, Twitter, DropBox, Github, Instagram and thousands of other sources using same techniques.</p>
<p>Finally, we will also learn how to handle errors, pagination to handle several pages and how to read an XML file in Reporting Services</p>
<h2>Requirements:</h2>
<ol>
<li>Make sure you have SSRS designer installed (You can download <a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017" target="_blank" rel="noopener">SSDT BI for Visual Studio 2015</a>).</li>
<li>In addition, we will need <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> Installed.</li>
</ol>
<h2>Getting Started</h2>
<p>You can access JSON / XML data in SSRS three different ways. We will only focus on one method in this article but please check other articles by clicking below links.</p>
<ol>
<li><strong>ZappySys Data Gateway</strong> &#8211; This method uses Microsoft SQL Server Connection Type option to connect to ZappySys Data Gateway. <a href="https://zappysys.zendesk.com/hc/en-us/articles/360015219514" target="_blank" rel="noopener">Check this</a></li>
<li><strong>Microsoft SQL Server</strong> <strong>(Linked Server)</strong> &#8211; This connection type which connects to SQL Server Linked Server. <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">Check this</a></li>
<li><strong>ODBC (Use ZappySys ODBC Driver)</strong> &#8211; You can use ODBC connection option in Report when you define data source (NOTE: There are some known issues with this method so we will not discuss)</li>
</ol>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">NOTE: If you are using Method#3 (ODBC Connection) in <strong>SSRS 2017</strong> or higher then you may have to do small changes listed under Troubleshooting section in this article. You may consider Method#2 or #3 if Direct ODBC Connection is not working for you.</div></div>
<p>Now lets look at steps to call REST API in SSRS (SQL Server reporting Services).</p>
<h3>Configure Data Source in Gateway (ZappySys JSON / REST API Driver Example)</h3>
<div class="content_block" id="custom_post_widget-5282">Now let's look at how to configure <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a>. This feature acts as a bridge between Client App and ZappySys Drivers. Using data gateway you can use ZappySys Drivers inside applications / operating systems where ZappySys drivers may not be available directly for some reason (e.g. You don't have access to Server for Installation or System does not support ODBC drivers like JAVA programs). <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-gateway/">Click here to read more</a> on various use cases of Data Gateway.
<h4><span style="font-size: 14pt;">Configure Data Gateway User / Port</span></h4>
Now let's look at steps to configure Data Gateway after installation. We will also create a sample data source for ODATA API (i.e. JSON based REST API Service).
<ol>
 	<li>Assuming you have installed <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> using default options (Which also enables Data Gateway Service)</li>
 	<li>Search "Gateway" in your start menu and click ZappySys Data Gateway
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Open ZappySys Data Gateway</p>

</div></li>
 	<li>First make sure Gateway Service is running (Verify Start icon is disabled)</li>
 	<li>Also verify Port on General Tab
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-1.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-1.png" alt="Port Number setting on ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Port Number setting on ZappySys Data Gateway</p>

</div></li>
 	<li>Now go to Users tab. <strong>Click Add</strong> icon to add a new user. Check Is admin to give access to all data sources you add in future. If you don't check admin then you have to manually configure user permission for each data source.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-2.png" alt="Add Data Gateway User" /></a>
<p class="wp-caption-text">Add Data Gateway User</p>

</div></li>
</ol>
&nbsp;
<h4><span style="font-size: 14pt;">Configure Data Source</span></h4>
<ol>
 	<li>After user is added, go to Data Sources tab. <strong>Click Add</strong> icon to create new data source. Select appropriate driver based on your API / File format. You can choose Generic ODBC option to read data from ODBC DSN or use Native Driver option.
<pre class=""><strong>NOTE:</strong> Whenever possible use native driver option for better performance / security and ease of use.</pre>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-3.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-3.png" alt="Add Gateway Data Source (Native JSON Driver)" /></a>
<p class="wp-caption-text">Add Gateway Data Source (Native JSON Driver)</p>

</div></li>
 	<li>Click on "Edit" under Data source and configure as per your need (e.g. Url, Connection, Request Method, Content Type, Body, Pagination etc.). For this demo we are going to pick simple JSON REST API which doesn't need any authentication.  Enter following URL.
<pre class="">https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json</pre>
</li>
 	<li>You can also view response structure and select default hierarchy (i.e. Filter) like below (Select Array Icon) for data extraction.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-4.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-4.png" alt="Configure JSON API Data source" /></a>
<p class="wp-caption-text">Configure JSON API Data source</p>

</div></li>
</ol>
<h4><span style="font-size: 14pt;">Test SQL Query / Preview Data</span></h4>
<ol>
 	<li>Now go to Preview Tab. You can click Preview button to execute default query
OR
Select Table name from dropdown to generate SQL with column names.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-5.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-5.png" alt="JSON / REST API Driver Query Preview / Query Examples (Read REST API or JSON Files)" /></a>
<p class="wp-caption-text">JSON / REST API Driver Query Preview / Query Examples (Read REST API or JSON Files)</p>

</div></li>
 	<li>You can also click Query Builder to generate SQL using different options in WITH clause. ANy setting you specify in WITH clause will override UI settings we applied in previous steps.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-6.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-6.png" alt="Using SQL Query Builder (For Files or REST / SOAP API - JSON / XML / CSV Format)" /></a>
<p class="wp-caption-text">Using SQL Query Builder (For Files or REST / SOAP API - JSON / XML / CSV Format)</p>

</div></li>
 	<li>There is another useful option for code generation. Select your Language and quickly copy code snippet. See below Example of XML Driver Query to call SOAP API.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-7.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-7.png" alt="Generate Example Code for ZappySys Driver" /></a>
<p class="wp-caption-text">Generate Example Code for ZappySys Driver</p>

</div></li>
 	<li><strong>Click OK</strong> to Close Data Source UI</li>
 	<li>Once data source is tested and configured you can <strong>click Save </strong>button in the Gateway UI toolbar and click <strong>Yes</strong> for <strong>Restart Service</strong>.</li>
</ol>
&nbsp;</div>
<h3>Configure SSRS Report Data source (Use ODBC Connection)</h3>
<p>Once you are done configuring ODBC DSN for REST API URL. The next step will be to create a new SSRS project.</p>
<ol>
<li>In SSRS, in a new Reporting Service Project, add a new Data Source:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-data-source.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-3219" src="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-data-source.jpg" alt="Add REST data source in SSRS" width="575" height="207" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-data-source.jpg 575w, https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-data-source-300x108.jpg 300w" sizes="(max-width: 575px) 100vw, 575px" /></a></li>
<li>Also, specify a name for the data source and in type select <strong>Microsoft SQL Server</strong>. Press <strong>Build</strong> to select the Data gateway connection information as below.
<div id="attachment_8180" style="width: 847px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-connect-json-rest-xml-zappysys-data-gateway-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8180" class="size-full wp-image-8180" src="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-connect-json-rest-xml-zappysys-data-gateway-driver.png" alt="Connect to JSON / REST API / SOAP in SSRS (Using ZappySys Data Gateway)" width="837" height="834" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-connect-json-rest-xml-zappysys-data-gateway-driver.png 837w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-connect-json-rest-xml-zappysys-data-gateway-driver-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-connect-json-rest-xml-zappysys-data-gateway-driver-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-connect-json-rest-xml-zappysys-data-gateway-driver-768x765.png 768w" sizes="(max-width: 837px) 100vw, 837px" /></a><p id="caption-attachment-8180" class="wp-caption-text">Connect to JSON / REST API / SOAP in SSRS (Using ZappySys Data Gateway)</p></div></li>
<li>Click OK to save our data source. We will use this Data source in next section.</li>
</ol>
<div class="mceTemp"></div>
<h3>Create a new SSRS Report</h3>
<p>Once your DSN is setup we can create report. There are two ways you can create reports.</p>
<ol>
<li>Create SSRS Reports using <strong>Report Builder</strong> App</li>
<li>Create SSRS Reports using <strong>Visual Studio</strong> (SSDT) &#8211; Download SSDT <a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017" target="_blank" rel="noopener">from Here</a></li>
</ol>
<p>In this section we will see second method (Visual Studio Method). Now let&#8217;s create a new SSRS report which uses the API data source we created in the previous section.</p>
<ol>
<li>Open Existing SSRS Project or Create a new Reporting Services Project by clicking File &gt; New. When Dialog Opens expand Business Intelligence category and select Reporting Services Project</li>
<li>When Solution opens Right-click on the Reports node and click Add New Report (Wizard mode)<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-add-new-json-report.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-3228" src="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-add-new-json-report.jpg" alt="Add report " width="436" height="271" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-add-new-json-report.jpg 436w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-add-new-json-report-300x186.jpg 300w" sizes="(max-width: 436px) 100vw, 436px" /></a></li>
<li>Press the query builder button<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-query-builder.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-3230" src="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-query-builder.jpg" alt="Create query from REST API" width="725" height="521" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-query-builder.jpg 725w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-query-builder-300x216.jpg 300w" sizes="(max-width: 725px) 100vw, 725px" /></a></li>
<li>Additionally, press the Add table icon and go to Views. Select value(DATA) and press add:<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/add-table-json-value-ssrs.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-3220" src="https://zappysys.com/blog/wp-content/uploads/2018/04/add-table-json-value-ssrs.jpg" alt="REST API view SSRS" width="917" height="522" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/add-table-json-value-ssrs.jpg 917w, https://zappysys.com/blog/wp-content/uploads/2018/04/add-table-json-value-ssrs-300x171.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/add-table-json-value-ssrs-768x437.jpg 768w" sizes="(max-width: 917px) 100vw, 917px" /></a></li>
<li>Press next in the following option until the completing wizard and specify a name for the report and check the option to Preview a report:</li>
<li>If everything is OK, you will be able to see the report and export the REST API data to Word, Excel, PowerPoint, etc:<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/json-export-word-excel-powerpoint.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-3223" src="https://zappysys.com/blog/wp-content/uploads/2018/04/json-export-word-excel-powerpoint.jpg" alt="Export REST to other formats" width="655" height="412" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/json-export-word-excel-powerpoint.jpg 655w, https://zappysys.com/blog/wp-content/uploads/2018/04/json-export-word-excel-powerpoint-300x189.jpg 300w" sizes="(max-width: 655px) 100vw, 655px" /></a></li>
</ol>
<p>Export JSON and REST API to word, Excel</p>
<h2>Working with parameters in SSRS (Dynamic SQL Query)</h2>
<p>So far we have seen how to pull data from Table exposed by our ODBC DSN for API Service. In the real world, you may have some sort of parameters passed to your API Service (e.g. CustomerID or Date Parameters).</p>
<p>So let&#8217;s configure our report to use parameters.</p>
<ol>
<li>We can work with parameters in SSRS. You can Add a Parameter in Parameters with the add parameter option:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/add-parameter.png"><img loading="lazy" decoding="async" class="alignnone wp-image-3234 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/add-parameter.png" alt="Add parameter in SSRS" width="340" height="106" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/add-parameter.png 340w, https://zappysys.com/blog/wp-content/uploads/2018/04/add-parameter-300x94.png 300w" sizes="(max-width: 340px) 100vw, 340px" /></a></li>
<li>We will create a parameter named CustomerID and it will be used to assign a customerID parameter:<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/general-parameter-ssis.png"><img loading="lazy" decoding="async" class="size-full wp-image-3236" src="https://zappysys.com/blog/wp-content/uploads/2018/04/general-parameter-ssis.png" alt="Parameter name" width="673" height="431" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/general-parameter-ssis.png 673w, https://zappysys.com/blog/wp-content/uploads/2018/04/general-parameter-ssis-300x192.png 300w" sizes="(max-width: 673px) 100vw, 673px" /></a></li>
<li>Create a data source and a dataset, drag and drop your columns to the report:<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/create-static-ssrs-report.png"><img loading="lazy" decoding="async" class="size-full wp-image-3235" src="https://zappysys.com/blog/wp-content/uploads/2018/04/create-static-ssrs-report.png" alt="Drag and drop columns SSRS" width="915" height="375" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/create-static-ssrs-report.png 915w, https://zappysys.com/blog/wp-content/uploads/2018/04/create-static-ssrs-report-300x123.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/create-static-ssrs-report-768x315.png 768w" sizes="(max-width: 915px) 100vw, 915px" /></a></li>
<li>Right-click your DataSet (which was generated by Report Wizard) and select DataSet properties:<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/json-change-dataset-properties-use-expression.png"><img loading="lazy" decoding="async" class="size-full wp-image-3237" src="https://zappysys.com/blog/wp-content/uploads/2018/04/json-change-dataset-properties-use-expression.png" alt="Dataset properties" width="419" height="318" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/json-change-dataset-properties-use-expression.png 419w, https://zappysys.com/blog/wp-content/uploads/2018/04/json-change-dataset-properties-use-expression-300x228.png 300w" sizes="(max-width: 419px) 100vw, 419px" /></a></li>
<li>Go to query and select Fx to create a dynamic SQL Query for our data source (Use expression / parameters in SQL):<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Just keep in mind that, if you use dynamic SQL for the data source (i.e. Using Expression in SQL) then Fields of that data source won&#8217;t refresh automatically when you save the UI. Workaround for this issue simple. Just use a static query for the first time to generate desired fields for the dataset. Once data source fields are generated you can add expression in your SQL Query.<br />
<strong>Static Query:</strong><br />
SELECT col1, col2 FROM rows WITH (SRC=&#8217;http://abc.com/invoice?year=2017&#8242;)<br />
<strong>Dynamic Query:</strong><br />
=&#8221;select col1, col2 from rows WITH (SRC=&#8217;http://abc.com/invoice?year='&#8221; + Parameters!Year.Value + &#8220;&#8216;)&#8221; </div></div><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-expression-use-variables.png"><img loading="lazy" decoding="async" class="size-full wp-image-3239" src="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-expression-use-variables.png" alt="Query expression in SRS" width="771" height="439" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-expression-use-variables.png 771w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-expression-use-variables-300x171.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-expression-use-variables-768x437.png 768w" sizes="(max-width: 771px) 100vw, 771px" /></a></li>
<li>On the expression dialog box, Enter SQL Query like below<br />
<pre class="crayon-plain-tag">="SELECT CustomerID, CompanyName, ContactName FROM value where CustomerID='"
+ Parameters!CustomerID.Value + "'"</pre>
</li>
<li>If you don&#8217;t want to use URL from DSN then you can supply API URL right inside your SQL Query like below.<br />
<pre class="crayon-plain-tag">="SELECT CustomerID, CompanyName, ContactName FROM value where CustomerID='"
+ Parameters!CustomerID.Value + "'" + 
"WITH (SRC='https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json')"</pre>
</li>
<li>You can now write a name as a parameter and receive the results:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/json-variable-get-value.png"><img loading="lazy" decoding="async" class="wp-image-3238 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/json-variable-get-value.png" alt="parameters with REST API using SSRS" width="705" height="327" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/json-variable-get-value.png 705w, https://zappysys.com/blog/wp-content/uploads/2018/04/json-variable-get-value-300x139.png 300w" sizes="(max-width: 705px) 100vw, 705px" /></a></li>
</ol>
<h2>Working with multi-value parameters in SSRS (Dynamic SQL Query)</h2>
<p>If you have a parameter which is multi-valued and you want to use it to filter data then follow the above section and in the expression dialog box use <strong>JOIN</strong> function to join the values, e.g.:</p>
<p><code>=SELECT CustomerID, CompanyName, ContactName FROM value where CustomerID IN ('" &amp; JOIN(Parameters!CustomerID.Value, "','") &amp; "')"</code></p>
<h2>Working with SSRS dataset filters (Client-side filtering)</h2>
<p>Sometimes its necessary to do filtering on data once it&#8217;s retrieved from the server. Dataset Filter is SSRS feature which does data filtering on the client side. To filter the report previously created, right click on the dataset and go to Filters. Press Add.</p>
<p>In this example, we will show how to show a customer with the customerID equal to ALFKI (or click on fx icon to use the expression for dynamic filter:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-add-filter.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-3232" src="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-add-filter.jpg" alt="Add filter for the data set" width="988" height="529" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-add-filter.jpg 988w, https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-add-filter-300x161.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/add-ssrs-add-filter-768x411.jpg 768w" sizes="(max-width: 988px) 100vw, 988px" /></a></p>
<p>Add filter SSRS REST API<span style="font-size: 16px;"> </span></p>
<h2>Working with date parameters in SSRS Reports</h2>
<p>Now lets look at how to handle date parameters and format them correctly. Most JSON /XML REST API handle dates in ISO format (i.e. yyyy-MM-ddTHH:mm:ss.fffZ). You can convert or format text parameters to date using the CDate function. The following example converts the parameter mydate from text to a date in SSRS:</p><pre class="crayon-plain-tag">CDate( Parameters!mydate.Value)</pre><p>
Next, we will show how to convert the date format to the format yyyy-MM-ddT00:00:00:</p><pre class="crayon-plain-tag">FORMAT(CDate( Parameters!mydate.Value),"yyyy-MM-ddT00:00:00")</pre><p>
Also, we will work with a REST API URL with data and retrieve the results:</p><pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json</pre><p>
Furthermore, in the ODBC Administrator add a connection to the previous URL (Or use URL inside SQL query WITH caluse as per previous section example):</p>
<div id="attachment_3231" style="width: 746px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/rest-working-dates-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3231" class="size-full wp-image-3231" src="https://zappysys.com/blog/wp-content/uploads/2018/04/rest-working-dates-1.png" alt="ODBC connection to REST API" width="736" height="279" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/rest-working-dates-1.png 736w, https://zappysys.com/blog/wp-content/uploads/2018/04/rest-working-dates-1-300x114.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-3231" class="wp-caption-text">URL with dates in REST API</p></div>
<p>The following example will convert the parameter to the same format as the URL and compare the OrderDate to the specified format:</p><pre class="crayon-plain-tag">="SELECT ShipName, ShipAddress, OrderDate FROM DATA.""value"" where 
OrderDate="+"'"+Cstr(FORMAT(CDate( Parameters!mydate.Value),"yyyy-MM-ddT00:00:00"))+"'"</pre><p>
&nbsp;</p>
<h2>Pass parameters in a Report URL</h2>
<p>In addition, when the report is published, you can specify a parameter in a URL. The following example shows how to pass a date in a parameter named mydate the value 1997-10-13:</p><pre class="crayon-plain-tag">http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project5
%2fReport5&amp;rs:Command=Render&amp;mydate=1997-10-13</pre><p>
&nbsp;</p>
<h2>Read JSON files in SSRS Reports</h2>
<p>Also, it is possible to connect to a JSON file instead of REST API. The steps are the same that the ones explained previously with the difference that we need to specify the path when we create the ODBC connection. The following example with show how to specify the path of a local JSON file in the connection:</p>
<div id="attachment_3233" style="width: 743px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-local-json-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3233" class="size-full wp-image-3233" src="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-local-json-file.png" alt="JSON file in SSRS" width="733" height="689" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-local-json-file.png 733w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-local-json-file-300x282.png 300w" sizes="(max-width: 733px) 100vw, 733px" /></a><p id="caption-attachment-3233" class="wp-caption-text">SSRS access to a local JSON file.</p></div>
<h2>Reading XML Files in SSRS Reports</h2>
<p>The next example will show how to read an XML file using SSRS.</p>
<p>The XML name is <strong>ZS.xml</strong> and it contains the following content:</p><pre class="crayon-plain-tag">&lt;?xml version="1.0"?&gt;
&lt;store storeid="s1"&gt;
	&lt;book id="bk101"&gt;
		&lt;author&gt;Gambardella, Matthew&lt;/author&gt;
		&lt;title&gt;XML Developer's Guide&lt;/title&gt;
		&lt;genre&gt;Computer&lt;/genre&gt;
		&lt;price&gt;44.95&lt;/price&gt;
		&lt;publish_date&gt;2000-10-01&lt;/publish_date&gt;
		&lt;description&gt;An in-depth look at creating applications with XML.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk102"&gt;
		&lt;author&gt;Ralls, Kim&lt;/author&gt;
		&lt;title&gt;Midnight Rain&lt;/title&gt;
		&lt;genre&gt;Fantasy&lt;/genre&gt;
		&lt;price&gt;5.95&lt;/price&gt;
		&lt;publish_date&gt;2000-12-16&lt;/publish_date&gt;
		&lt;description&gt;A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk103"&gt;
		&lt;author&gt;Corets, Eva&lt;/author&gt;
		&lt;title&gt;Maeve Ascendant&lt;/title&gt;
		&lt;genre&gt;Fantasy&lt;/genre&gt;
		&lt;price&gt;5.95&lt;/price&gt;
		&lt;publish_date&gt;2000-11-17&lt;/publish_date&gt;
		&lt;description&gt;After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk104"&gt;
		&lt;author&gt;Corets, Eva&lt;/author&gt;
		&lt;title&gt;Oberon's Legacy&lt;/title&gt;
		&lt;genre&gt;Fantasy&lt;/genre&gt;
		&lt;price&gt;5.95&lt;/price&gt;
		&lt;publish_date&gt;2001-03-10&lt;/publish_date&gt;
		&lt;description&gt;In post-apocalypse England, the mysterious agent known only as Oberon helps to create a new life for the inhabitants of London. Sequel to Maeve Ascendant.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk105"&gt;
		&lt;author&gt;Corets, Eva&lt;/author&gt;
		&lt;title&gt;The Sundered Grail&lt;/title&gt;
		&lt;genre&gt;Fantasy&lt;/genre&gt;
		&lt;price&gt;5.95&lt;/price&gt;
		&lt;publish_date&gt;2001-09-10&lt;/publish_date&gt;
		&lt;description&gt;The two daughters of Maeve, half-sisters, battle one another for control of England. Sequel to Oberon's Legacy.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk106"&gt;
		&lt;author&gt;Randall, Cynthia&lt;/author&gt;
		&lt;title&gt;Lover Birds&lt;/title&gt;
		&lt;genre&gt;Romance&lt;/genre&gt;
		&lt;price&gt;4.95&lt;/price&gt;
		&lt;publish_date&gt;2000-09-02&lt;/publish_date&gt;
		&lt;description&gt;When Carla meets Paul at an ornithology conference, tempers fly as feathers get ruffled.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk107"&gt;
		&lt;author&gt;Thurman, Paula&lt;/author&gt;
		&lt;title&gt;Splish Splash&lt;/title&gt;
		&lt;genre&gt;Romance&lt;/genre&gt;
		&lt;price&gt;4.95&lt;/price&gt;
		&lt;publish_date&gt;2000-11-02&lt;/publish_date&gt;
		&lt;description&gt;A deep sea diver finds true love twenty thousand leagues beneath the sea.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk108"&gt;
		&lt;author&gt;Knorr, Stefan&lt;/author&gt;
		&lt;title&gt;Creepy Crawlies&lt;/title&gt;
		&lt;genre&gt;Horror&lt;/genre&gt;
		&lt;price&gt;4.95&lt;/price&gt;
		&lt;publish_date&gt;2000-12-06&lt;/publish_date&gt;
		&lt;description&gt;An anthology of horror stories about roaches, centipedes, scorpions and other insects.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk109"&gt;
		&lt;author&gt;Kress, Peter&lt;/author&gt;
		&lt;title&gt;Paradox Lost&lt;/title&gt;
		&lt;genre&gt;Science Fiction&lt;/genre&gt;
		&lt;price&gt;6.95&lt;/price&gt;
		&lt;publish_date&gt;2000-11-02&lt;/publish_date&gt;
		&lt;description&gt;After an inadvertant trip through a Heisenberg Uncertainty Device, James Salway discovers the problems of being quantum.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk110"&gt;
		&lt;author&gt;O'Brien, Tim&lt;/author&gt;
		&lt;title&gt;Microsoft .NET: The Programming Bible&lt;/title&gt;
		&lt;genre&gt;Computer&lt;/genre&gt;
		&lt;price&gt;36.95&lt;/price&gt;
		&lt;publish_date&gt;2000-12-09&lt;/publish_date&gt;
		&lt;description&gt;Microsoft's .NET initiative is explored in detail in this deep programmer's reference.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk111"&gt;
		&lt;author&gt;O'Brien, Tim&lt;/author&gt;
		&lt;title&gt;MSXML3: A Comprehensive Guide&lt;/title&gt;
		&lt;genre&gt;Computer&lt;/genre&gt;
		&lt;price&gt;36.95&lt;/price&gt;
		&lt;publish_date&gt;2000-12-01&lt;/publish_date&gt;
		&lt;description&gt;The Microsoft MSXML3 parser is covered in detail, with attention to XML DOM interfaces, XSLT processing, SAX and more.&lt;/description&gt;
	&lt;/book&gt;
	&lt;book id="bk112"&gt;
		&lt;author&gt;Galos, Mike&lt;/author&gt;
		&lt;title&gt;Visual Studio 7: A Comprehensive Guide&lt;/title&gt;
		&lt;genre&gt;Computer&lt;/genre&gt;
		&lt;tag&gt;tag1&lt;/tag&gt; 
		&lt;price&gt;49.95&lt;/price&gt;
		&lt;publish_date&gt;2001-04-16&lt;/publish_date&gt;
		&lt;description&gt;Microsoft Visual Studio 7 is explored in depth, looking at how Visual Basic, Visual C++, C#, and ASP+ are integrated into a comprehensive development environment.&lt;/description&gt;
	&lt;/book&gt;
&lt;/store&gt;</pre><p>
<p class="lang:default highlight:0 decode:true ">This example will read an XML file named ZS.xml. First, in ODBC Administrator add the ZappySys ODBC XML Driver:</p>
<div id="attachment_3255" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/xml-driver-ssrs.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3255" class="size-full wp-image-3255" src="https://zappysys.com/blog/wp-content/uploads/2018/04/xml-driver-ssrs.png" alt="XML ODBC in SSRS" width="460" height="349" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/xml-driver-ssrs.png 460w, https://zappysys.com/blog/wp-content/uploads/2018/04/xml-driver-ssrs-300x228.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-3255" class="wp-caption-text">ODBC SSRS FOR XML</p></div>
<p>In data source, specify the path of the file:</p>
<div id="attachment_3254" style="width: 617px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-xml-ssrs.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3254" class="size-full wp-image-3254" src="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-xml-ssrs.png" alt="ODBC to XML" width="607" height="582" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-xml-ssrs.png 607w, https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-xml-ssrs-300x288.png 300w" sizes="(max-width: 607px) 100vw, 607px" /></a><p id="caption-attachment-3254" class="wp-caption-text">XML configuration</p></div>
<p>Once created the connection, create your report in SSDT in the query, add the following query:</p>
<p>SELECT author, genre, title, price, publish_date<br />
FROM DATA.&#8221;store.book&#8221;</p>
<div id="attachment_3257" style="width: 737px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/query-xml-ssrs.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3257" class="size-full wp-image-3257" src="https://zappysys.com/blog/wp-content/uploads/2018/04/query-xml-ssrs.png" alt="Create query to XML in SSRS" width="727" height="309" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/query-xml-ssrs.png 727w, https://zappysys.com/blog/wp-content/uploads/2018/04/query-xml-ssrs-300x128.png 300w" sizes="(max-width: 727px) 100vw, 727px" /></a><p id="caption-attachment-3257" class="wp-caption-text">Create a query to XML in SSRS</p></div>
<p>Finally, you can visualize your report in SSRS:</p>
<div id="attachment_3258" style="width: 570px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-xml-report-generated.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3258" class="size-full wp-image-3258" src="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-xml-report-generated.png" alt="SSRS reading XML " width="560" height="468" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-xml-report-generated.png 560w, https://zappysys.com/blog/wp-content/uploads/2018/04/ssrs-xml-report-generated-300x251.png 300w" sizes="(max-width: 560px) 100vw, 560px" /></a><p id="caption-attachment-3258" class="wp-caption-text">SSRS reading XML</p></div>
<h2>REST API Security &#8211; Working with OAuth (Facebook API example)</h2>
<p>If you API requires credentials then no worries, ZappySys Drivers come with many security standards support. Most common credential types are Basic Auth and  OAuth. These are open standard to access Web Services. In this new example, we will show how to read Facebook information in SSRS (Call Facebook Graph API).</p>
<p>For demo we will read the number of friends on Facebook:</p>
<div id="attachment_10094" style="width: 348px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/facebook-information-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10094" class="wp-image-10094 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/facebook-information-1.png" alt="Friends on Facebook" width="338" height="265" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/facebook-information-1.png 338w, https://zappysys.com/blog/wp-content/uploads/2018/04/facebook-information-1-300x235.png 300w" sizes="(max-width: 338px) 100vw, 338px" /></a><p id="caption-attachment-10094" class="wp-caption-text">Friends on Facebook</p></div>
<p>First, we will open the ODBC Data Source:</p>
<div id="attachment_3265" style="width: 401px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-data-source-64bits-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3265" class="wp-image-3265 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-data-source-64bits-1.jpg" alt="ODBC Data Source" width="391" height="523" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-data-source-64bits-1.jpg 391w, https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-data-source-64bits-1-224x300.jpg 224w" sizes="(max-width: 391px) 100vw, 391px" /></a><p id="caption-attachment-3265" class="wp-caption-text">ODBC Data Source</p></div>
<p>In Authentication type, select OAuth. We will use the following link to get the friends information on Facebook:</p><pre class="crayon-plain-tag">https://graph.facebook.com/v1.0/me/friends?</pre><p>
This link retrieves information of my friends. For more information about the Facebook graph API, check our references.</p>
<p>&nbsp;</p>
<div id="attachment_3261" style="width: 621px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/connection-information.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3261" class="size-full wp-image-3261" src="https://zappysys.com/blog/wp-content/uploads/2018/04/connection-information.png" alt="" width="611" height="689" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/connection-information.png 611w, https://zappysys.com/blog/wp-content/uploads/2018/04/connection-information-266x300.png 266w" sizes="(max-width: 611px) 100vw, 611px" /></a><p id="caption-attachment-3261" class="wp-caption-text">Facebook connection properties</p></div>
<p>Secondly, go to OAuth settings and select Facebook as the OAuth Provider. You will need a Client Id and a Client Secret. To get a client id and a client secret, you will need to create a Facebook application <a href="https://developers.facebook.com/">here</a>. For more information about creating a Facebook application, check this <a href="https://zappysys.com/blog/register-facebook-oauth-app-graph-api/">link</a>.</p>
<p>Scopes will use user_friends to get Facebook friends information.  For a list of scopes, please check <a href="https://developers.facebook.com/docs/facebook-login/permissions">here</a>.</p>
<div id="attachment_3270" style="width: 596px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/oauth-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3270" class="size-full wp-image-3270" src="https://zappysys.com/blog/wp-content/uploads/2018/04/oauth-settings.png" alt="OAuth settins" width="586" height="493" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/oauth-settings.png 586w, https://zappysys.com/blog/wp-content/uploads/2018/04/oauth-settings-300x252.png 300w" sizes="(max-width: 586px) 100vw, 586px" /></a><p id="caption-attachment-3270" class="wp-caption-text">OAuth settings</p></div>
<p>Once that the connection is created, you need to create an SSRS report using the ODBC connection just created. In the query, we will create the following query:</p>
<p>&nbsp;</p>
<div id="attachment_3266" style="width: 734px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/query-facebook.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3266" class="size-full wp-image-3266" src="https://zappysys.com/blog/wp-content/uploads/2018/04/query-facebook.png" alt="SSRS query to Facebook" width="724" height="579" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/query-facebook.png 724w, https://zappysys.com/blog/wp-content/uploads/2018/04/query-facebook-300x240.png 300w" sizes="(max-width: 724px) 100vw, 724px" /></a><p id="caption-attachment-3266" class="wp-caption-text">SSRS query to Facebook</p></div>
<p>If everything is OK, you will be able to see the number of Facebook friends:</p>
<div id="attachment_3267" style="width: 160px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/report-ssrs-result.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3267" class="size-full wp-image-3267" src="https://zappysys.com/blog/wp-content/uploads/2018/04/report-ssrs-result.png" alt="Facebook friends in SSRS" width="150" height="156" /></a><p id="caption-attachment-3267" class="wp-caption-text">Facebook friends in SSRS</p></div>
<h2></h2>
<h2>POST Parameters to SSRS Report (avoid GET for long string in URL)</h2>
<p>You can call reports from browser using following way (Pass parameters in URL). Below Method by default sends GET requests to Report Server and render report in HTML format in your browser.</p><pre class="crayon-plain-tag">http://localhost/reports/report/MySampleReports/Report1?MyParameter1=AAA&amp;MyParameter2=BBB</pre><p>
However there is a problem if you have a very long string as parameter value. In that case use <a href="https://docs.microsoft.com/en-us/sql/reporting-services/application-integration/integrating-reporting-services-using-url-access-web-application?view=sql-server-2017" target="_blank" rel="noopener">FORM POST method described in this article</a>.</p>
<p>You can try yourself. Just create an html file on your machine and paste below code. Run it in a browser (If you have UAC ON then First launch Browser as Admin and then paste full path of your HTML file). Click on a button displayed in that page to mimic POST.</p>
<p><strong>TestPost.html</strong></p><pre class="crayon-plain-tag">&lt;html&gt;
	&lt;body&gt;		
		&lt;!--  use _self or _blank to control where report opens... same window or new window ? --&gt;

		&lt;form id="frmRender" action="http://localhost/ReportServer/Pages/ReportViewer.aspx?/MyProject1/Report1" method="post" target="_blank"&gt;
		&lt;!-- &lt;form id="frmRender" action="http://localhost/reportserver?/MyProject1/Report1" method="post" target="_self"&gt;  --&gt;
			&lt;input type="hidden" name="rs:Command" value="Render" /&gt;
			&lt;input type="hidden" name="rc:LinkTarget" value="_blank" /&gt;
			&lt;input type="hidden" name="rs:Format" value="HTML4.0" /&gt; &lt;!-- report format --&gt;
			&lt;input type="hidden" name="rc:Parameters" value="false" /&gt;  &lt;!-- display report parameters --&gt;
			
			&lt;input type="submit" value="Open Report With Parameters (POST Example)"&gt;  
			
			&lt;br /&gt;
			&lt;br /&gt;
			Fill out below parameters and click above button
			&lt;br /&gt;
			&lt;br /&gt;
			&lt;input name="Notes"  name="Notes" value="xyz-long-string-goes-here" /&gt;
			&lt;!-- &lt;input type="hidden" name="param2" value="xxxx" /&gt; --&gt;

		&lt;/form&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre><p>
You can use expression like below in your Report to confirm Data Length of posted Parameter</p><pre class="crayon-plain-tag">="My Parameter Length is " &amp; Parameters!Notes.Value.ToString().Length</pre><p>
Also you can use below expression to make your query dynamic as below</p><pre class="crayon-plain-tag">="SELECT data,origin,url FROM _root_ " + 
 "WITH(SRC='http://httpbin.org/post', " + 
 "METHOD='POST', " +
 "HEADER='Content-Type: text/plain', " + 
 "BODY='" + Parameters!Notes.Value + 
 "')"</pre><p>
&nbsp;</p>
<p>&nbsp;</p>
<h2>Deploying SSRS Report (for ODBC Connection)</h2>
<p><strong>NOTE:</strong> In this section we will make sure few thing for ODBC Connection Type. If you used Data Gateway approach then you may skip this section.</p>
<p>Once you done with design and testing of reports, our next step would be deploy reports to SSRS Server. This section describes things to make sure when you deploy reports.</p>
<p><strong>Find DSN Name and Full ConnectionString of original DSN</strong></p>
<ol>
<li>First thing to make sure you install ODBC PowerPack on the report server too (Unless you are using SQL Server Connection Type to connect to Gateway and you dont plan to run it on SSRS Server)</li>
<li>Once ODBC PowerPack is installed on the server next step is to setup DSN Used by Reports.  SSRS Service is 64 bit so DSN must be 64 bit and must be named Exact same way just like how you used during Design Phase on Client PC where reports are designed.</li>
<li>To Setup DSN exact same way try this step. First go to Client PC where reports are designed. Open ODBC DSN which you used for Report. Copy two things 1) Name of your DSN, and Find <strong>Copy Connection String</strong> Button to copy full connection string of your DSN.</li>
</ol>
<p><strong>Create new DSN(s) on SSRS Server using original settings</strong></p>
<ol>
<li>Now Remote Desktop (rdp) to SSRS Server, search of <strong>odbc 64 bit</strong>. Open it and go to <strong>System</strong> Tab.
<div id="attachment_5919" style="width: 603px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-dsn-admin-create-dsn-based-on-json-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5919" class="wp-image-5919 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-dsn-admin-create-dsn-based-on-json-driver.png" alt="Create System ODBC DSN (64-bit)" width="593" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-dsn-admin-create-dsn-based-on-json-driver.png 593w, https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-dsn-admin-create-dsn-based-on-json-driver-300x255.png 300w" sizes="(max-width: 593px) 100vw, 593px" /></a><p id="caption-attachment-5919" class="wp-caption-text">Create System ODBC DSN (64-bit)</p></div></li>
<li>Click <strong>Add</strong> to create new DSN just like we did very beginning of this article. Select Driver you wish to use.</li>
<li>Once Driver UI opens up change default DSN name to <strong>exact same name</strong> like we gave it for SSRS Report on client PC.</li>
<li>find <strong>Load Connection String</strong> Button and paste connection string we obtained in previous step.
<div id="attachment_4753" style="width: 816px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4753" class="wp-image-4753 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring.png" alt="ZappySys ODBC Driver - Load Connection String Example" width="806" height="696" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring.png 806w, https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring-300x259.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/08/zappysys-odbc-driver-load-connectionstring-768x663.png 768w" sizes="(max-width: 806px) 100vw, 806px" /></a><p id="caption-attachment-4753" class="wp-caption-text">ZappySys ODBC Driver &#8211; Load Connection String Example</p></div></li>
<li>Click Test connection see everything good. Click OK to save DSN</li>
<li><strong>Repeat these steps</strong> for each DSN used in SSRS Report.</li>
</ol>
<h3><strong>Things to know about SSRS 2017 or Higher / Report Builder</strong></h3>
<p>We had few users who reported issue with SSRS 2017 after deployment (Everything worked fine during design time). You may get below error when try to preview report from server URL. You may sometimes notice that after saving report in Report Builder if you try to preview <strong>Report Builder hangs</strong> and you have to restart SSRS service. If you notice any such issue you may have to apply following fix..</p>
<p>Error:</p><pre class="crayon-plain-tag">Cannot create a connection to data source 'YourDataSourceName'. ---&amp;gt; System.Data.Odbc.OdbcException:</pre><p>
In such case check steps listed in <strong>Troubleshooting Section</strong> later this article.</p>
<p>&nbsp;</p>
<h2>Calling SOAP XML Web Service in SSRS (SQL Reporting Services)</h2>
<p>So far we have looked at examples to consume data using JSON driver. Now let&#8217;s look at an example, to call XML SOAP Web Service in SSRS.</p>
<div class="content_block" id="custom_post_widget-3870">To call SOAP API you need to know Request XML Body Structure. If you are not sure how to create SOAP Request body then no worries. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn how to generate SOAP Request body using the Free tool <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a>. Basically, you have to use SoapUI to generate Request XML and after that, you can replace parameters as needed in the generated body.
<h3>What is SOAP Web Service?</h3>
If you are new to SOAP Web Service sometimes referred as XML Web Service then please read some concept about SOAP Web service standard <a href="https://msdn.microsoft.com/en-us/library/ms996507.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener">from this link</a>

There are two important aspects in SOAP Web service.
<ol>
 	<li>Getting WSDL file or URL</li>
 	<li>Knowing exact Web Service URL</li>
</ol>
<h3>What is WSDL</h3>
In very simple term WSDL (often pronounced as whiz-dull) is nothing but a document which describes Service metadata (e.g. Functions you can call, Request parameters, response structure etc). Some service simply give you WSDL as xml file you can download on local machine and then analyze or sometimes you may get direct URL (e.g. http://api.mycompany.com/hr-soap-service/?wsdl )
<h3>Example SQL Query for SOAP API call using ZappySys XML Driver</h3>
Here is an example SQL query you can write to call SOAP API. If you not sure about many details then check next few sections on how to use XML Driver User Interface to build desired SQL query to POST data to XML SOAP Web Service without any coding.
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
Now let's look at steps to create SQL query to call SOAP API. Later we will see how to generate code for your desired programming language (e.g. C# or SQL Server)
<h3>Video Tutorial - Introduction to SOAP Web Service and SoapUI tool</h3>
Before we dive into details about calling SOAP API using ZappySys XML Driver, lets first understand what is SOAP API and how to create SOAP requests using SoapUI tool. You will learn more about this process in the later section. The video contains some fragment about using SOAP API in SSIS but just ignore that part because we will be calling Soap API using ZappySys ODBC Driver rather than SSIS Components.

&nbsp;

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/d_x5bgGjg0Y?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe>
<h3>Using SoapUI to test SOAP API call / Create Request Body XML</h3>
Assuming you have downloaded and installed <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI from here</a>, now we are ready to use WSDL for your SOAP Web Service Calls. If you do not have WSDL file or URL handy then contact your API provider (sometimes you just have to add <strong>?wsdl </strong>at the end of your Service URL to get WSDL so try that. Example: http://mycompany/myservice?wsdl ).

If you don't know what is WSDL then in short, WSDL is <strong>Web service Description Language</strong> (i.e. XML file which describes your SOAP Service). WSDL helps to craft SOAP API request Body for ZappySys XML Driver. So Let's get started.
<ol>
 	<li>Open SoapUI and click SOAP button to create new SOAP Project</li>
 	<li>Enter WSDL URL or File Path of WSDLFor example WSDL for our sample service can be accessed via this URL
<pre class="lang:default highlight:0 decode:true">http://www.dneonline.com/calculator.asmx?wsdl</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-import-wsdl-new-soapui-project.png"><img loading="lazy" decoding="async" class="size-full wp-image-3871" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-14.png" alt="Create new SOAP API Project in SoapUI tool for SOAP API Testing" width="486" height="349" /></a>
<div style="margin-bottom: 1em;">Create new SOAP API Project in SoapUI tool for SOAP API Testing</div></li>
 	<li>Once WSDL is loaded you will see possible operations you can call for your SOAP Web Service.</li>
 	<li>If your web service requires credentials then you have to configure it. There are two common credential types for public services (<strong>SOAP WSS</strong> or <strong>BASIC</strong> )
<ol>
 	<li>
<div style="margin-bottom: 1em;">To use <strong>SOAP WSS Credentials</strong> select request node and enter UserId, Password, and <strong>WSS-PasswordType</strong> (PasswordText or PasswordHash)</div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-soap-wss-credentials-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3872 alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)" width="294" height="544" /></a>
<div style="display: block;">Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)</div></li>
 	<li>To use <strong>BASIC Auth</strong> Credentials select request node and double-click it. At the bottom click on Auth (Basic) and From Authorization dropdown click Add New and Select Basic.<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-basic-authentication-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3873" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure Basic Authorization for SoapUI (SOAP API Testing Tool)" width="616" height="653" /></a>
<div style="margin-bottom: 1em;">Configure Basic Authorization for SoapUI (SOAP API Testing Tool)</div></li>
</ol>
</li>
 	<li>Now you can test your request first Double-click on the request node to open request editor.</li>
 	<li>Change necessary parameters, remove optional or unwanted parameters. If you want to regenerate request you can click on <strong>Recreate default request toolbar icon</strong>.
<a href="https://zappysys.com/blog/wp-content/uploads/2016/06/create-soap-request-with-optional-parameters-soapui.png"><img loading="lazy" decoding="async" class="size-full wp-image-2812" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-4.png" alt="Create SOAP Request XML (With Optional Parameters)" width="807" height="315" /></a>
<div style="margin-bottom: 1em;">Create SOAP Request XML (With Optional Parameters)</div></li>
 	<li>Once your SOAP Request XML is ready, <strong>Click the Play button</strong> in the toolbar to execute SOAP API Request and Response will appear in Right side panel.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soapui-test-soap-api-request-response-edit-xml-body.png"><img loading="lazy" decoding="async" class="size-full wp-image-3874" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-5.png" alt="Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)" width="1216" height="511" /></a>
Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)</li>
</ol>
<h3>Create DSN using ZappySys XML Driver to call SOAP API</h3>
Once you have tested your SOAP API in SoapUI tool, we are ready to use ZappySys XML driver to call SOAP API in your preferred BI tool or Programming language.
<ol>
 	<li>First open <strong>ODBC Data Sources</strong> (search ODBC in your start menu or go under ZappySys &gt; ODBC PowerPack &gt; <strong>ODBC 64 bit</strong>)</li>
 	<li>Goto <strong>System DSN</strong> Tab (or User DSN which is not used by Service account)</li>
 	<li>Click <strong>Add</strong> and Select ZappySys XML Driver
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-6.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" /></a>
ZappySys ODBC Driver for XML / SOAP API</li>
 	<li>Configure API URL, Request Method and Request Body as below
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3876" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-7.png" alt="ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body" width="916" height="874" /></a>
ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body</li>
 	<li><strong>(This step is Optional)</strong> If your SOAP API requires credentials then Select Connection Type to HTTP and configure as below.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-call-credential-basic-soap-wss-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3877" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-8.png" alt="ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)" width="564" height="483" /></a>
<div style="display: block;">ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)</div></li>
 	<li>Configure-Request Headers as below (You can get it from Request &gt; Raw tab from SoapUI after you test the request by clicking the Play button)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/set-soap-api-request-headers-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3881" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-9.png" alt="Configure SOAP API Request Headers - ZappySys XML Driver" width="1009" height="747" /></a>
Configure SOAP API Request Headers - ZappySys XML Driver</li>
 	<li>Once credentials entered you can select Filter to extract data from the desired node. Make sure to select array node (see special icon) or select the node which contains all necessary columns if you don't have array node.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-query-select-filter-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3882" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-10.png" alt="Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)" width="809" height="594" /></a>
Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)</li>
 	<li>If prompted select yes to treat selected node as Array (This is helpful when you expect one or more record for selected node)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-api-array-handling-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3883" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-11.png" alt="Treat selected node as XML Array Option for SOAP API Response XML" width="655" height="572" /></a>
Treat selected node as XML Array Option for SOAP API Response XML</li>
</ol>
<h3>Preview SOAP API Response / Generate SQL Code for SOAP API Call</h3>
Once you configure settings for XML Driver now you can preview data or generate example code for desired language (e.g. C#, Python, Java, SQL Server).

Go to Preview tab and you will see default query generated based on settings you entered in previous sections. Attributes listed in WITH clause are optional. If you omit attribute in WITH clause it will use it from Properties tab.
<h3>Preview Data</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3884" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-12.png" alt="Preview SOAP API Response in ZappySys XML Driver" width="808" height="780" /></a>
Preview SOAP API Response in ZappySys XML Driver
<h3>Generate Code Option</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-driver-code-generator.png"><img loading="lazy" decoding="async" class="size-full wp-image-3885" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-13.png" alt="Generate Example Code for ZappySys Driver" width="572" height="618" /></a>
<div style="display: block;">Generate Example Code for ZappySys Driver</div></div>
<h2>SOAP / REST API pagination in SSRS Reports</h2>
<div class="content_block" id="custom_post_widget-3892"><div style="margin-bottom: 1em;">Even we set up ODBC Data Source to get the data, it may not be enough. Usually, if you are getting a huge data set from API provider, it won't give it to you in one HTTP response. Instead, it gives back only a subset of data and provides a mechanism for data pagination. The good news is that <em>ZappySys ODBC Driver</em> includes many options to cover virtually any pagination method.</div>
<div><span style="font-size: 16px;">Below you will find a few examples of API pagination. If you need something more sophisticated check the below link (the article was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too):</span></div>
<div style="margin-bottom: 1em;"><a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/</a></div>
<h3>Paginate by Response Attribute</h3>
This example shows how to paginate API calls where you need to paginate until the last page detected. In this example, next page is indicated by some attribute called nextlink (found in response). If this attribute is missing or null then it stops fetching the next page.
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH(
SRC=@'https://zappysys.com/downloads/files/test/pagination_nextlink_inarray_1.json'
,NextUrlAttributeOrExpr = '$.nextlink'  --keep reading until this attribute is missing. If attribute name contains dot then use brackets like this $.['my.attr.name']
)</pre>
<h3>Paginate by URL Parameter (Loop until certain StatusCode)</h3>
This example shows how to paginate API calls where you need to pass page number via URL. The driver keeps incrementing page number and calls next URL until the last page detected (401 error). There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/page-xml.aspx?page=1&amp;mode=DetectBasedOnResponseStatusCode'
,PagingMode='ByUrlParameter'
,PagingByUrlAttributeName='page'
,PagingByUrlEndStrategy='DetectBasedOnResponseStatusCode'
,PagingByUrlCheckResponseStatusCode=401
,IncrementBy=1
)</pre>
<h3>Paginate by URL Path (Loop until no record)</h3>
This example shows how to paginate API calls where you need to pass page number via URL Path. The driver keeps incrementing page number and calls next URL until the last page is detected. There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/cust-&lt;%page%&gt;.xml'
,PagingMode='ByUrlPath'
,PagingByUrlAttributeName='&lt;%page%&gt;'
,PagingByUrlEndStrategy='DetectBasedOnRecordCount'
,IncrementBy=1
)</pre>
<h3>Paginate by Header Link (RFC 5988)</h3>
API like GitHub / Wordpress use Next link in Headers (<a href="https://tools.ietf.org/html/rfc5988" target="_blank" rel="noopener">RFC 5988</a>)
<pre class="lang:default decode:true ">SELECT * FROM $
LIMIT 25
WITH(
	 Src='https://wordpress.org/news/wp-json/wp/v2/categories?per_page=10'
	,PagingMode='ByResponseHeaderRfc5988'
	,WaitTimeMs='200' --//wait 200 ms after each request
)</pre>
&nbsp;</div>
<h2>SOAP / REST API Error Handling in SSRS Reports</h2>
<div class="content_block" id="custom_post_widget-3894">Sometimes errors occur... they just do and there is nothing you can do! Or can you? Actually, in ODBC PowerPack you can handle them in two ways.
<h3>METHOD 1 - Using Error Handling Options</h3>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3949" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-1.png" alt="" width="668" height="702" />
<h4>When to use?</h4>
You may want to use them when your source is a resource located on the Internet; e.g. a file on a website, a file on an FTP server or just a plain API HTTP response. By default, when a remote server returns an error, data retrieval is stopped, an error is raised and no data is given back to you. This might not be always desirable.
<h4>Scenario 1</h4>
Imagine a scenario, that there is a web server which each day at 12 AM releases a new JSON file with that day's date as filename, e.g. <span style="text-decoration: underline;"><em>http://www.some-server.com/data/2018-06-20.json</em></span>. And, of course, you want to download it and use it daily in your Power BI report. But you have a problem: Power BI report data sources are refreshed each hour and you may get <a href="https://en.wikipedia.org/wiki/HTTP_404" target="_blank" rel="noopener">HTTP 404 status code</a> (no file was found) when a file is not released yet. Which consequentially means other data sources won't be updated as well and you will see old and cached data on the report. That's where you could use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue when Url is invalid or missing (404 Errors)</span></strong> to avoid an error being raised and let other data sources to be updated.
<h4>Scenario 2</h4>
Another scenario is when you expect a web server to raise some kind of HTTP error when accessing a URL. You don't want ODBC Data Source to raise an error but instead, you want to get response data. That's where you can use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or alike together with  <strong><span class="lang:default highlight:0 decode:true crayon-inline">Get response data on error</span></strong> to continue on an error and get the data:

<img loading="lazy" decoding="async" class="alignnone wp-image-3961 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png" alt="" width="547" height="235" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png 547w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error-300x129.png 300w" sizes="(max-width: 547px) 100vw, 547px" />
<h3>METHOD 2 - Using Connection [Retry Settings]</h3>
Another scenario you may run into is a buggy web server. You ask it to give you some file or data and it, like a snotty kid, just doesn't give it to you! You have to ask twice or thrice before it does its job. If that's the case, you have to retry HTTP requests using <em>Connection</em>:

<img loading="lazy" decoding="async" class="alignnone wp-image-3963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-3.png" alt="" width="671" height="572" /></div>
<h2>Security / Connection Types (Options for HTTP, OAuth, SOAP) in SSRS Reports</h2>
<div class="content_block" id="custom_post_widget-3896"><div style="margin-bottom: 1em;">If you need to authenticate or authorize your user to access a web resource, you will need to use one of the <em>Connections:</em></div>
<ul>
 	<li>HTTP</li>
 	<li>OAuth</li>
</ul>
<img loading="lazy" decoding="async" class="wp-image-4078 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png" alt="ZappySys XML Driver - HTTP and OAuth Connection Types" width="577" height="302" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w" sizes="(max-width: 577px) 100vw, 577px" />
<h3>HTTP Connection</h3>
<div style="margin-bottom: 1em;">Use <em>HTTP Connection</em> for simple Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!</div>
<div style="margin-bottom: 1em;">You can also use <em>HTTP Connection</em> for more sophisticated authentication like:</div>
<ul>
 	<li><strong>SOAP WSS</strong> (when accessing a SOAP WebService)</li>
 	<li><strong>Static Token / API Key</strong> (when need to pass an API key in HTTP header)</li>
 	<li><strong>Dynamic Token</strong> (same as Static Token method except that each time you need to log in and retrieve a fresh API key)</li>
 	<li><strong>JWT Token</strong> (As per RFC 7519)</li>
</ul>
<img loading="lazy" decoding="async" class="alignnone wp-image-4091 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-1.png" alt="" width="622" height="570" />
<h3>OAuth</h3>
If you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection</em>. <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">Read this article</a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>, but the concepts and UI stay the same): <br/>
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/</a>
<img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-2.png" width="721" height="708" /></div>
<h2>Other Consideration for Calling Web API in SSRS Reports</h2>
<div class="content_block" id="custom_post_widget-3901">There are few settings you can coder while calling Web API
<h3><strong>API Limit / Throttling</strong></h3>
While calling public API or other external web services one important aspect you have to check,  how many requests are allowed by your API. Especially when you use API pagination options to pull many records you have to slow down based on API limits. For example, your API may allow you only 5 requests per second. Use Throttling Tab on Driver UI to set delay after each request.
<h3><strong>2D Array Transformation</strong></h3>
If you are using JSON or XML API Driver then possible you may have to transform your data using 2D array transformation feature. <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Check this link</a> for more information.

&nbsp;</div>
<h2>Working with pagination to read REST API using SSRS</h2>
<p>Another important aspect of any API call is handling pagination. When you have many records to read from API, most likely your API won&#8217;t send you data in one response. You have to loop through all pages of data until the last page is detected. ZappySys driver comes with many options to configure virtually any pagination strategy.</p>
<p>Here is the screenshot of Pagination options included in ZappySys JSON / XML API Driver:</p>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/pagination.png"><img loading="lazy" decoding="async" class="wp-image-3272 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/pagination.png" alt="Pagination to read REST API using SSRS" width="688" height="469" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/pagination.png 688w, https://zappysys.com/blog/wp-content/uploads/2018/04/pagination-300x205.png 300w" sizes="(max-width: 688px) 100vw, 688px" /></a></p>
<p>Moreover, you can configure the maximum page number and the response length. It is also possible to set the minimum response length.</p>
<p>In addition, you can also configure the page number increment and pagination mode. You can also specify conditions to detect the last page and more.</p>
<h2>Reading API data from SQL Server Stored Procedure</h2>
<p>If you want to read data from SQL Server Stored procedure rather than using Data gateway or ODBC connection then <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/">check this post</a>.</p>
<h2>Handling errors to read REST API using SSRS</h2>
<p>The ZappySys ODBC PowerPack allows handling errors. For example, if the page is not found (error 404), the driver can continue working. You can also continue on any error. Continue on status code, stop the execution on error or more options:</p>
<div id="attachment_3274" style="width: 617px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-errors-ssrs.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3274" class="size-full wp-image-3274" src="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-errors-ssrs.png" alt="SSRS - REST API Error Handling Options" width="607" height="587" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-errors-ssrs.png 607w, https://zappysys.com/blog/wp-content/uploads/2018/04/odbc-errors-ssrs-300x290.png 300w" sizes="(max-width: 607px) 100vw, 607px" /></a><p id="caption-attachment-3274" class="wp-caption-text">SSRS &#8211; REST API Error Handling Options</p></div>
<h2>Troubleshooting SSRS Issues</h2>
<p>If you experience problems accessing data from ODBC data source, you may try to set up a data source in <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a> and access it instead. Check <a href="https://zappysys.zendesk.com/hc/en-us/articles/360015219514-Troubleshooting-errorless-SSRS-crashes-when-getting-data-from-an-API-via-ODBC-driver" target="_blank" rel="noopener">how to troubleshoot errors when SSRS crashes</a> to find out how to accomplish that.</p>
<h3><strong>Report Builder Hangs / ODBC Connection errors in SSRS 2017 or Higher </strong></h3>
<p>Sometimes you may notice that after saving Report to Server in Report Builder when you preview it hangs or you may get below error. This issue may occur If you are using SSRS 2017 or higher and report is using <strong>ODBC Connection Type.</strong> If your preview hangs or get below error then you have to try few steps listed below to avoid such error. This error may occur in other version too but from our experience it mostly happens in newer SSRS version.</p><pre class="crayon-plain-tag">ERROR : Cannot create a connection to data source 'YourDataSourceName'. ---&gt; System.Data.Odbc.OdbcException:</pre><p>
Steps to fix this error.</p>
<ol>
<li>First we have to Gac Newtonsoft.json.dll. For this search for &#8220;<strong>Powershell ISE</strong>&#8221; and right click and <strong>launch as Admin</strong></li>
<li>Run below command to register Dll<br />
<pre class="crayon-plain-tag">[Reflection.Assembly]::LoadWithPartialName("System.EnterpriseServices") | Out-Null 
[System.EnterpriseServices.Internal.Publish] $publish = new-object System.EnterpriseServices.Internal.Publish

$publish.GacInstall("C:\Program Files (x86)\ZappySys\ZappySys ODBC PowerPack\JsonDriverX86\Newtonsoft.Json.dll")</pre>
</li>
<li>Now go to SSRS Install folder typically found here<br />
<pre class="crayon-plain-tag">C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer</pre>
</li>
<li>Find <strong>rssrvpolicy.config</strong> . Backup the file before making any changes below. Right click on the file and edit it.</li>
<li>n the above config file we need to add extract CodeGroup nodes for each ZappySys Driver dll Path which you like to use in SSRS Reports. For demo purpose we have added XML and JSON driver paths you can do more as needed. Basically in SSRS 2012 this may not be needed but in newer version of SSRS (i.e. 2017 and higher) Custom Drivers or Assemblies need Grant to execute under SSRS service. Here is the code you have to add in config file.<br />
<pre class="crayon-plain-tag">&lt;CodeGroup class="UnionCodeGroup"
                 version="1"
                 PermissionSetName="FullTrust"
                 Name="ZappyOdbcJsonDllFullTrust"
                 Description="Code group for ZappySys JSON Driver - 64bit"&gt;
                    &lt;IMembershipCondition class="UrlMembershipCondition"
                       version="1"
                       Url="C:\Program Files (x86)\ZappySys\ZappySys ODBC PowerPack\JsonDriverX64\ZappySys.Odbc.Json.dll"
                     /&gt;
              &lt;/CodeGroup&gt; 
              &lt;CodeGroup class="UnionCodeGroup"
                 version="1"
                 PermissionSetName="FullTrust"
                 Name="ZappyOdbcXmlDllFullTrust"
                 Description="Code group for ZappySys XML Driver - 64bit"&gt;
                    &lt;IMembershipCondition class="UrlMembershipCondition"
                       version="1"
                       Url="C:\Program Files (x86)\ZappySys\ZappySys ODBC PowerPack\XmlDriverX64\ZappySys.Odbc.Xml.dll"
                     /&gt;
              &lt;/CodeGroup&gt; 
              &lt;!-- to do - add more driver entries here --&gt;
			  
              &lt;CodeGroup class="UnionCodeGroup"
                 version="1"
                 PermissionSetName="FullTrust"
                 Name="ZappyDllFullTrust"
                 Description="Code group for all common ZappySys dlls"&gt;
                    &lt;IMembershipCondition class="StrongNameMembershipCondition"
                       version="1"
                       PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100c997874c205e00cc82fc09f40f718a6384103bc4a6300abbdcce09a20f554aa82c89e51dbcfaee9c9480dd25ea76d97c2a4562aeb51c169dab3e6be9054edec2aaa994937a670f651fb4037292c535a10cccba9b886c92262424f3ef786f9830acdcb98aff39567e4bf56d304f546239c0d235a4d59497c030891711db4b29cc"
                     /&gt;
              &lt;/CodeGroup&gt;</pre>
</li>
<li>Here is <strong>Full rsssrvpolicy.config</strong> code in case you like to review. Your file may slightly different so dont just copy full content as is.<br />
<pre class="crayon-plain-tag">&lt;configuration&gt;
  &lt;mscorlib&gt;
    &lt;security&gt;
      &lt;policy&gt;
        &lt;PolicyLevel version="1"&gt;
          &lt;SecurityClasses&gt;
            &lt;SecurityClass Name="AllMembershipCondition" Description="System.Security.Policy.AllMembershipCondition, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="AspNetHostingPermission" Description="System.Web.AspNetHostingPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="DnsPermission" Description="System.Net.DnsPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="EnvironmentPermission" Description="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="FileIOPermission" Description="System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="FirstMatchCodeGroup" Description="System.Security.Policy.FirstMatchCodeGroup, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="IsolatedStorageFilePermission" Description="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="NamedPermissionSet" Description="System.Security.NamedPermissionSet"/&gt;
            &lt;SecurityClass Name="PrintingPermission" Description="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/&gt;
            &lt;SecurityClass Name="ReflectionPermission" Description="System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="RegistryPermission" Description="System.Security.Permissions.RegistryPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="SecurityPermission" Description="System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="SocketPermission" Description="System.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="SqlClientPermission" Description="System.Data.SqlClient.SqlClientPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="StrongNameMembershipCondition" Description="System.Security.Policy.StrongNameMembershipCondition, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="UnionCodeGroup" Description="System.Security.Policy.UnionCodeGroup, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="UrlMembershipCondition" Description="System.Security.Policy.UrlMembershipCondition, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="WebPermission" Description="System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
            &lt;SecurityClass Name="ZoneMembershipCondition" Description="System.Security.Policy.ZoneMembershipCondition, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
          &lt;/SecurityClasses&gt;
          &lt;NamedPermissionSets&gt;
            &lt;PermissionSet
                    class="NamedPermissionSet"
                    version="1"
                    Unrestricted="true"
                    Name="FullTrust"
                    Description="Allows full access to all resources"
                        /&gt;
            &lt;PermissionSet
                    class="NamedPermissionSet"
                    version="1"
                    Name="Nothing"
                    Description="Denies all resources, including the right to execute"
                        /&gt;
            &lt;PermissionSet
                    class="NamedPermissionSet"
                    version="1"
                    Name="Execution"&gt;
              &lt;IPermission
                      class="SecurityPermission"
                      version="1"
                      Flags="Execution"
                            /&gt;
            &lt;/PermissionSet&gt;
          &lt;/NamedPermissionSets&gt;
          &lt;CodeGroup
                  class="FirstMatchCodeGroup"
                  version="1"
                  PermissionSetName="Nothing"&gt;
            &lt;IMembershipCondition
                    class="AllMembershipCondition"
                    version="1"
                        /&gt;
            &lt;CodeGroup
                    class="UnionCodeGroup"
                    version="1"
                    PermissionSetName="Execution"
                    Name="Report_Expressions_Default_Permissions"
                    Description="This code group grants default permissions for code in report expressions and Code element. "&gt;
              &lt;IMembershipCondition
                      class="StrongNameMembershipCondition"
                      version="1"
                      PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100512C8E872E28569E733BCB123794DAB55111A0570B3B3D4DE3794153DEA5EFB7C3FEA9F2D8236CFF320C4FD0EAD5F677880BF6C181F296C751C5F6E65B04D3834C02F792FEE0FE452915D44AFE74A0C27E0D8E4B8D04EC52A8E281E01FF47E7D694E6C7275A09AFCBFD8CC82705A06B20FD6EF61EBBA6873E29C8C0F2CAEDDA2"
                            /&gt;
            &lt;/CodeGroup&gt;
            &lt;CodeGroup
                    class="FirstMatchCodeGroup"
                    version="1"
                    PermissionSetName="Execution"
                    Description="This code group grants MyComputer code Execution permission. "&gt;
              &lt;IMembershipCondition
                        class="ZoneMembershipCondition"
                        version="1"
                        Zone="MyComputer" /&gt;
              &lt;CodeGroup
                      class="UnionCodeGroup"
                      version="1"
                      PermissionSetName="FullTrust"
                      Name="Microsoft_Strong_Name"
                      Description="This code group grants code signed with the Microsoft strong name full trust. "&gt;
                &lt;IMembershipCondition
                        class="StrongNameMembershipCondition"
                        version="1"
                        PublicKeyBlob="002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293"
                                /&gt;
              &lt;/CodeGroup&gt;
              &lt;CodeGroup
                      class="UnionCodeGroup"
                      version="1"
                      PermissionSetName="FullTrust"
                      Name="Ecma_Strong_Name"
                      Description="This code group grants code signed with the ECMA strong name full trust. "&gt;
                &lt;IMembershipCondition
                        class="StrongNameMembershipCondition"
                        version="1"
                        PublicKeyBlob="00000000000000000400000000000000"
                                /&gt;
              &lt;/CodeGroup&gt;
              &lt;CodeGroup
                      class="UnionCodeGroup"
                      version="1"
                      PermissionSetName="FullTrust"
                      Name="Report_Server_Strong_Name"
                      Description="This code group grants Report Server code full trust. "&gt;
                &lt;IMembershipCondition
                        class="StrongNameMembershipCondition"
                        version="1"
                        PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8"
                                /&gt;
              &lt;/CodeGroup&gt;
              &lt;CodeGroup
                      class="UnionCodeGroup"
                      version="1"
                      PermissionSetName="FullTrust"&gt;
                &lt;IMembershipCondition
                        class="UrlMembershipCondition"
                        version="1"
                        Url="$CodeGen$/*"
                                /&gt;
              &lt;/CodeGroup&gt;
              &lt;CodeGroup
                      class="UnionCodeGroup"
                      version="1"
                      PermissionSetName="FullTrust"
                      Name="SharePoint_Server_Strong_Name"
                      Description="This code group grants SharePoint Server code full trust. "&gt;
                &lt;IMembershipCondition
                        class="StrongNameMembershipCondition"
                        version="1"
                        PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100AFD4A0E7724151D5DD52CB23A30DED7C0091CC01CFE94B2BCD85B3F4EEE3C4D8F6417BFF763763A996D6B2DFC1E7C29BCFB8299779DF8785CDE2C168CEEE480E570725F2468E782A9C2401302CF6DC17E119118ED2011937BAE9698357AD21E8B6DFB40475D16E87EB03C744A5D32899A0DBC596A6B2CFA1E509BE5FBD09FACF"
                                /&gt;
              &lt;/CodeGroup&gt;
              &lt;CodeGroup
                      class="UnionCodeGroup"
                      version="1"
                      PermissionSetName="FullTrust"
                      Name="Analisys_Server_Strong_Name"
                      Description="This code group grants DataFeedClient.dll full trust. "&gt;
                &lt;IMembershipCondition
                        class="StrongNameMembershipCondition"
                        version="1"
                        PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8"
                                /&gt;
              &lt;/CodeGroup&gt;
              &lt;CodeGroup
                     class="UnionCodeGroup" 
                     version="1" 
                     PermissionSetName="FullTrust" 
                     Name="OXML_SDK_Strong_Name" 
                     Description="Grants FullTrust to OpenXmlSdk"&gt;
                &lt;IMembershipCondition 
                        class="StrongNameMembershipCondition" 
                        version="1" 
                        PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9" 
                                /&gt;
              &lt;/CodeGroup&gt;

              &lt;CodeGroup class="UnionCodeGroup"
                 version="1"
                 PermissionSetName="FullTrust"
                 Name="ZappyOdbcJsonDllFullTrust"
                 Description="Code group for zappy json processing extension"&gt;
                    &lt;IMembershipCondition class="UrlMembershipCondition"
                       version="1"
                       Url="C:\Program Files (x86)\ZappySys\ZappySys ODBC PowerPack\JsonDriverX64\ZappySys.Odbc.Json.dll"
                     /&gt;
              &lt;/CodeGroup&gt; 
              &lt;CodeGroup class="UnionCodeGroup"
                 version="1"
                 PermissionSetName="FullTrust"
                 Name="ZappyOdbcXmlDllFullTrust"
                 Description="Code group for zappy json processing extension"&gt;
                    &lt;IMembershipCondition class="UrlMembershipCondition"
                       version="1"
                       Url="C:\Program Files (x86)\ZappySys\ZappySys ODBC PowerPack\XmlDriverX64\ZappySys.Odbc.Xml.dll"
                     /&gt;
              &lt;/CodeGroup&gt; 
              &lt;!-- to do - add more driver entries here --&gt;
			  
              &lt;CodeGroup class="UnionCodeGroup"
                 version="1"
                 PermissionSetName="FullTrust"
                 Name="ZappyDllFullTrust"
                 Description="Code group for all zappy dlls"&gt;
                    &lt;IMembershipCondition class="StrongNameMembershipCondition"
                       version="1"
                       PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100c997874c205e00cc82fc09f40f718a6384103bc4a6300abbdcce09a20f554aa82c89e51dbcfaee9c9480dd25ea76d97c2a4562aeb51c169dab3e6be9054edec2aaa994937a670f651fb4037292c535a10cccba9b886c92262424f3ef786f9830acdcb98aff39567e4bf56d304f546239c0d235a4d59497c030891711db4b29cc"
                     /&gt;
              &lt;/CodeGroup&gt;
			  
            &lt;/CodeGroup&gt;
          &lt;/CodeGroup&gt;
        &lt;/PolicyLevel&gt;
      &lt;/policy&gt;
    &lt;/security&gt;
  &lt;/mscorlib&gt;
&lt;/configuration&gt;</pre>
&nbsp;</li>
<li>Thats it now Restart SSRS Service after above change and you should be fine. If you still face the issue we suggest you use <a href="https://zappysys.zendesk.com/hc/en-us/articles/360015219514">Data Gateway approach</a>.</li>
</ol>
<h2>Conclusion</h2>
<p>To conclude, we can say that it is now easy to get JSON and REST API data in SSRS. We only need to download the <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> and we will be able to access the data.</p>
<p>Furthermore, you learned how to work with parameters (Dynamic Queries), with dates and pass parameters to URL.</p>
<h2>References</h2>
<p>Finally, for more information about how to read REST API using SSRS you can check the following links:<br />
⦁ <a href="https://zappysys.com/blog/category/odbc-powerpack/">Category Archives: ODBC PowerPack</a><br />
⦁ <a href="https://docs.microsoft.com/en-us/sql/reporting-services/developer/rest-api?view=sql-server-2017">Develop with the REST APIs for Reporting Services</a><br />
⦁ <a href="https://developers.facebook.com/docs/graph-api/using-graph-api">Facebook Graph API</a></p>
<p>Keywords: SSRS JSON data source, SSRS REST API data source, SSRS SOAP Web Service data source, Call REST API in SSRS, Load JSON into SSRS, Read REST API in SSRS, Read XML SOAP Web Service in SSRS, Read JSON file in SSRS,<br />
Read XML file in SSRS</p>
<p>The post <a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/">How to read REST API in SSRS Reports (JSON / XML / Call SOAP Web Service)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
