tag:blogger.com,1999:blog-31901665798157462242024-03-11T00:47:26.699-07:00SQL JourneyThis blog was created as a way for me to share some of the challenges and ideas that I have experienceNisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-3190166579815746224.post-91979839131346527732014-06-28T12:20:00.000-07:002017-09-15T09:14:37.860-07:00Pattern Search and Replace function–Simple SQL<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
I have recently got a request from my insurance client to replace the non acceptable character with space in the PolicyHolder name before sending to Employers' Liability Tracing Office (ELTO). Also, it should allow a quick search incase of an investigation from ELTO.<br />
I always like the wildcard search facility in the SQL server as they are quick and can avoid huge amount of coding. E.g. let us say we want to ignore all the special character expect “@” character<br />
<pre class="csharpcode"><div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;">
<div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: blue;">Create</span> <span style="color: blue;">table</span> #temp</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum2" style="color: #606060;"> 2:</span> (policyholdername <span style="color: blue;">varchar</span>(30))</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum3" style="color: #606060;"> 3:</span> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum4" style="color: #606060;"> 4:</span> insert <span style="color: blue;">into</span> #temp <span style="color: blue;">values</span> (<span style="color: #006080;">'Nishar/123'</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum5" style="color: #606060;"> 5:</span> insert <span style="color: blue;">into</span> #temp <span style="color: blue;">values</span>(<span style="color: #006080;">'Nishar@123'</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum6" style="color: #606060;"> 6:</span> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum7" style="color: #606060;"> 7:</span> <span style="color: blue;">select</span> * <span style="color: blue;">from</span> #temp <span style="color: blue;">where</span> policyholdername <span style="color: blue;">not</span> <span style="color: blue;">like</span> <span style="color: #006080;">'%[^@a-zA-Z1-9]%'</span></pre>
<!--CRLF--></div>
</div>
<span style="font-family: Trebuchet MS;">The above code will only pick the second row and delivers it out of the box. But unfortunately SQL server doesn’t give a Pattern Replace function out of the box so the only option is to create an user defined function.</span> </pre>
<br />
Below function has been developed with below goals in mind<br />
<br />
<ul><br />
<li>Create a function which should be generic </li>
<li>uses the natural SQL functions rather than costly cursors or loops. </li>
</ul>
<br />
<div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;">
<br />
<div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: blue;">ALTER</span> <span style="color: blue;">FUNCTION</span> PatReplace ( @sInput <span style="color: blue;">VARCHAR</span>( <span style="color: blue;">max</span>),@NonAllowedPattern <span style="color: blue;">varchar</span>(<span style="color: blue;">max</span> ),@ReplaceWith <span style="color: blue;">Varchar</span> (1))</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum2" style="color: #606060;"> 2:</span> <span style="color: blue;">RETURNS</span> <span style="color: blue;">VARCHAR</span> (<span style="color: blue;">max</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum3" style="color: #606060;"> 3:</span> <span style="color: blue;">AS</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum4" style="color: #606060;"> 4:</span> <span style="color: blue;">BEGIN</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum5" style="color: #606060;"> 5:</span> --<span style="color: green;">-- =============================================</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum6" style="color: #606060;"> 6:</span> --<span style="color: green;">-- Author: <Mohamed Nishar></span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum7" style="color: #606060;"> 7:</span> --<span style="color: green;">-- Create date: <05/06/14></span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum8" style="color: #606060;"> 8:</span> --<span style="color: green;">-- Description: Replace all characters matching with NonAllowedPattern based on supplied replacewith character</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum9" style="color: #606060;"> 9:</span> --<span style="color: green;">-- =============================================</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum10" style="color: #606060;"> 10:</span> <span style="color: blue;">DECLARE</span> @Clenoutput <span style="color: blue;">AS</span> <span style="color: blue;">VARCHAR</span>( <span style="color: blue;">max</span>);</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum11" style="color: #606060;"> 11:</span> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum12" style="color: #606060;"> 12:</span> <span style="color: blue;">WITH</span> CTE_patreplace</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum13" style="color: #606060;"> 13:</span> <span style="color: blue;">AS</span> (</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum14" style="color: #606060;"> 14:</span> <span style="color: green;">-- Check for any non allowed character and repalce it with new cahracter specified</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum15" style="color: #606060;"> 15:</span> <span style="color: blue;">SELECT</span> <span style="color: blue;">CASE</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum16" style="color: #606060;"> 16:</span> <span style="color: blue;">WHEN</span> <span style="color: blue;">substring</span> (@sInput, N, 1 ) <span style="color: blue;">LIKE</span> @NonAllowedpattern</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum17" style="color: #606060;"> 17:</span> <span style="color: blue;">THEN</span> @ReplaceWith</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum18" style="color: #606060;"> 18:</span> <span style="color: blue;">ELSE</span> <span style="color: blue;">substring</span> (@sInput, N, 1 )</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum19" style="color: #606060;"> 19:</span> <span style="color: blue;">END</span> sPolicyHolderNameCleanChar</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum20" style="color: #606060;"> 20:</span> <span style="color: blue;">FROM</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum21" style="color: #606060;"> 21:</span> <span style="color: green;">-- A dummy table which generates long list of key numbers to strip the supplied string into individual character set</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum22" style="color: #606060;"> 22:</span> (</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum23" style="color: #606060;"> 23:</span> <span style="color: blue;">SELECT</span> row_number () <span style="color: blue;">OVER</span> (</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum24" style="color: #606060;"> 24:</span> <span style="color: blue;">ORDER</span> <span style="color: blue;">BY</span> sc1.NAME</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum25" style="color: #606060;"> 25:</span> ) <span style="color: blue;">AS</span> n</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum26" style="color: #606060;"> 26:</span> <span style="color: blue;">FROM</span> master .dbo. syscolumns sc1</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum27" style="color: #606060;"> 27:</span> ,master. dbo.syscolumns sc2</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum28" style="color: #606060;"> 28:</span> ) <span style="color: blue;">AS</span> tal</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum29" style="color: #606060;"> 29:</span> <span style="color: blue;">WHERE</span> n <= LEN( @sInput)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum30" style="color: #606060;"> 30:</span> )</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum31" style="color: #606060;"> 31:</span> <span style="color: blue;">SELECT</span> @Clenoutput = (</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum32" style="color: #606060;"> 32:</span> <span style="color: green;">-- FOR XML is used here to combine multiple rows (list of character from previous query) into single value</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum33" style="color: #606060;"> 33:</span> <span style="color: blue;">SELECT</span> isnull (stuff((</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum34" style="color: #606060;"> 34:</span> (</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum35" style="color: #606060;"> 35:</span> <span style="color: blue;">SELECT</span> <span style="color: #006080;">''</span> + sPolicyHolderNameCleanChar</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum36" style="color: #606060;"> 36:</span> <span style="color: blue;">FROM</span> CTE_patreplace</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum37" style="color: #606060;"> 37:</span> <span style="color: blue;">FOR</span> XML <span style="color: blue;">PATH</span>( <span style="color: #006080;">''</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum38" style="color: #606060;"> 38:</span> ,root( <span style="color: #006080;">'MyString'</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum39" style="color: #606060;"> 39:</span> ,type</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum40" style="color: #606060;"> 40:</span> ).<span style="color: blue;">value</span>( <span style="color: #006080;">'/MyString[1]'</span>, <span style="color: #006080;">'varchar(max)'</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum41" style="color: #606060;"> 41:</span> ), 1, 0, <span style="color: #006080;">''</span>), <span style="color: #006080;">''</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum42" style="color: #606060;"> 42:</span> )</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum43" style="color: #606060;"> 43:</span> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum44" style="color: #606060;"> 44:</span> <span style="color: blue;">RETURN</span> @Clenoutput</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span id="lnum45" style="color: #606060;"> 45:</span> <span style="color: blue;">END</span></pre>
<!--CRLF--></div>
</div>
<br />
Happy reading <img alt="Smile" class="wlEmoticon wlEmoticon-smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3rHpwbKQPcrz4W_jGXhD8zZ0wYYo4wlhyphenhyphengMoe9hqh0qJstG-fHqKyHisEfUaX2YoLwTysUxkSslUZz7PXcBcR5yJSkpu6ST5DnO0MBOO4xbBeorDEwP_QL_b4fRqWaVbth_DSUL1UzHY/?imgmax=800" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none;" /></div>
Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-6688760463858251952014-03-08T05:03:00.000-08:002014-03-09T03:18:24.324-07:00SSRS Deployment–Complete Automation–2012 & 2008<p> </p> <p>One of the most demanding and long awaiting feature in SSRS is “Automation of Deployment”. So in this blog I am going to share simple steps to completely automate the deployment and will share the tested vb.net code, but before getting into the automated script let us explore the available options</p> <ol> <li><font style="background-color: #ffff00"><strong>BIDS Development</strong> <strong>environment</strong></font>(or SQL data tools in 2012) can deploy your packages to the desired server <ol> <li>Pros <ol> <li>Very easy to configure</li></ol> <li>Cons <ol> <li>Not practical for production rollout, as most companies follows segregation of duties. So developer won’t have production access and DBA shouldn’t open the package in development tools. <li>Most often you want to deploy only one or two changes in the specific report rather than the whole package <li>Always deploy the latest version of code. We can’t specify the version or Branching in TFS/subversion.</li></ol></li></ol> <li><strong><font style="background-color: #ffff00">Report Manager</font></strong> <ol> <li>pros <ol> <li>Can be used by DBA with some knowledge in SSRS <li>Can deploy specific objects</li></ol> <li>Cons <ol> <li>Completely manual and mistake can easily happen <li>Some organisation don’t have dedicated DBAs and they don’t have much knowledge about the SSRS <li>Deployment instruction will be very lengthy and will consume significant amount of developer’s time incase of multiple reports and shared dataset</li></ol></li></ol> <li><strong><font style="background-color: #ffff00">RS.exe ( via web service) – 2005 name space</font></strong> <ol> <li>Pros <ol> <li>Deployment can be automated (partially) <li>Famous <a href="http://sqlserverfinebuild.codeplex.com/wikipage?title=Install+Reporting+Services+Scripter">RSscripter</a> (was written by Jasper Smith) is developed based on 2005 namespace and was very helpful to produce automated scripts</li></ol> <li>Cons <ol> <li>The scripts are very tedious to edit and develop. <li>There is no build tool available from Microsoft <li>2005 namespace doesn’t support linking of items(e.g. report to dataset and so on)</li></ol></li></ol> <li><font style="background-color: #ffff00">RS.Exe (via web service) – 2010 Name space</font> <ol> <li>Pros <ol> <li>Deployment can be fully automated include linking of items</li></ol> <li>Cons <ol> <li>No tools available in the market to automate the deployment <li>RSscripter doesn’t get it’s update for 2010 namespace</li></ol></li></ol></li></ol> <p>So the best option is RS.exe with 2010 namespace. I was searching for the automated script and found the article from John Desch in the Microsoft blog <a href="http://blogs.msdn.com/b/johndesch/archive/2012/12/17/using-the-rs-exe-utility-to-deploy-a-report-server-project-and-shared-dataset.aspx">Click here</a></p> <p>it is one of the best automated script available in the market now as it uses the latest namespace. But it has it own limitations so in the blog i have expanded the functionality and given the revised code and steps to automate your deployment.</p> <p><font style="background-color: #ffff00">Enhancement</font> </p> <ul> <ol> <li>The code doesn't work with 2008Sp1 and above. It requires the buffer error fix. <li>The code tries to link all the reports in the deployed report folder from the servers to their Data source. This will create a problem, if you want to deploy only two reports in the existing 8 report pack. So created an additional method (UpdateDataSources_report) to link only the deployed report into their respective sources <li>The code Doesn't link the Shared data set to Report. so created an additional method (UpdateDataSet_report) which will automatically link your report to their respective datasets <li>The existing code doesn't overwrite the files if they exist. changed the flags (for dataset and report only) as the deployment usually requires overwriting the existing objects. <li>At last it would be easy if you have a single deployment script with command prompt variable so that you can pass to DBA. SO created a deploy.bat with variables</li></ol></ul> <p><font style="background-color: #ffff00">Automation Steps</font></p> <ol> <li>You can download the code and batch file from my skydrive (or one drive <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2UDiwdzTesE2eJ0l72qWmIxOf-VrM-mDFxC1UJe6VQz4Q_DsRtmN9AU6SwUTtmAzkfjcBlMHMl7W8iR139IZOh6fZt_RHNU2fWkxC8AO0ryqN41WQmtMwVvdKrean3TJIhX3poic1t_I/?imgmax=800">)</li> <ol> <li><a href="https://onedrive.live.com/?cid=0363B73C0DA07C62&id=363B73C0DA07C62%21159">CommonScript.rss</a> <li><a href="https://onedrive.live.com/?cid=0363B73C0DA07C62&id=363B73C0DA07C62%21160">Deploy.bat</a></li></ol> <li>Save both file in same folder in your local drive <li>Create a folder named “Reports” under this new folder <li>Now copy all the reports, datasource and dataset into the “Reports” folder <li>Now Deploy.bat has the below variables amend them accordingly</li> <p> varServerPath=<a href="http://local/reportserver">http://local/reportserver</a> ---- <font color="#0000ff">Desired Server URL</font><br>set varReportFolder=Test/Testdeploy ---- Server folder path --from the main <br>Set varDatasetFolder=Datasets ---- Dataset folder path<br>set varDataSourceFolder=Data Sources ---- Datasource path<br>Set varDataSourcePath=Data Sources ---- Datasource path again (Yes this is Redundant)<br>set varReportName= -----If you want to restrict the script to one report then mention it’s name without</p> <p> extension else leave it blank<br>set varReportFilePath=%\Reports ---- Local folder path where you stored your reports and dependant objects.</p></ol> <p> </p> <p>Now, you can zip the folder and send it to DBA (Note: please test the script in your development server first) </p> <p> </p> <p><strong>FAQ</strong></p> <ul> <li>Can I refer two different datasource folder for different dataset?</li> <ul> <li>NO, you need to declare a collection object and modify the code. This is very rare occasion.</li></ul> <li> Report is not able to link my dataset.</li> <ul> <li>Check the name in your report. Shared dataset should be creaed with same name</li></ul> <li>Can I deploy report in multiple folder path</li> <ul> <li>Yes, you need divide them into multiple deployment package</li></ul></ul> <p> </p> <p><font style="background-color: #ffff00">Revised Code (save the script as Commonscript.rss)</font></p> <p> </p> <div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4"> <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum1" style="color: #606060"> 1:</span> <span style="color: #008000">'Begin Script</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum2" style="color: #606060"> 2:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum3" style="color: #606060"> 3:</span> <span style="color: #0000ff">Dim</span> definition <span style="color: #0000ff">As</span> [<span style="color: #0000ff">Byte</span>]() = <span style="color: #0000ff">Nothing</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum4" style="color: #606060"> 4:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum5" style="color: #606060"> 5:</span> <span style="color: #0000ff">Dim</span> bytedefinition <span style="color: #0000ff">as</span> [<span style="color: #0000ff">Byte</span>]() = <span style="color: #0000ff">nothing</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum6" style="color: #606060"> 6:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum7" style="color: #606060"> 7:</span> <span style="color: #0000ff">Dim</span> warnings <span style="color: #0000ff">As</span> Warning() = <span style="color: #0000ff">Nothing</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum8" style="color: #606060"> 8:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum9" style="color: #606060"> 9:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum10" style="color: #606060"> 10:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum11" style="color: #606060"> 11:</span> <span style="color: #008000">'Main Entry point of utility</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum12" style="color: #606060"> 12:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum13" style="color: #606060"> 13:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Sub</span> Main()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum14" style="color: #606060"> 14:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum15" style="color: #606060"> 15:</span> Console.WriteLine()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum16" style="color: #606060"> 16:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum17" style="color: #606060"> 17:</span> Console.WriteLine(<span style="color: #006080">"Initiating Deployment"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum18" style="color: #606060"> 18:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum19" style="color: #606060"> 19:</span> rs.Credentials = System.Net.CredentialCache.DefaultCredentials</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum20" style="color: #606060"> 20:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum21" style="color: #606060"> 21:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum22" style="color: #606060"> 22:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum23" style="color: #606060"> 23:</span> <span style="color: #008000">'Create the shared data source</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum24" style="color: #606060"> 24:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum25" style="color: #606060"> 25:</span> CreateFolders(DataSourceFolder,<span style="color: #006080">"/"</span>,<span style="color: #006080">"Data Sources"</span>,<span style="color: #006080">"Visible"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum26" style="color: #606060"> 26:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum27" style="color: #606060"> 27:</span> <span style="color: #008000">'Create the folder that will contain the shared data sets</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum28" style="color: #606060"> 28:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum29" style="color: #606060"> 29:</span> CreateFolders(DataSetFolder, <span style="color: #006080">"/"</span>, <span style="color: #006080">"Data Set Folder"</span>, <span style="color: #006080">"Visible"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum30" style="color: #606060"> 30:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum31" style="color: #606060"> 31:</span> <span style="color: #008000">'Create the folder that will contain the deployed reports</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum32" style="color: #606060"> 32:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum33" style="color: #606060"> 33:</span> CreateFolders(ReportFolder, <span style="color: #006080">"/"</span>, <span style="color: #006080">"Report Folder"</span>,<span style="color: #006080">"Visible"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum34" style="color: #606060"> 34:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum35" style="color: #606060"> 35:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">As</span> Exception</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum36" style="color: #606060"> 36:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum37" style="color: #606060"> 37:</span> Console.WriteLine(goof.Message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum38" style="color: #606060"> 38:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum39" style="color: #606060"> 39:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum40" style="color: #606060"> 40:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum41" style="color: #606060"> 41:</span> ReadFiles(filepath, <span style="color: #006080">"*.rds"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum42" style="color: #606060"> 42:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum43" style="color: #606060"> 43:</span> ReadFiles(filepath, <span style="color: #006080">"*.rsd"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum44" style="color: #606060"> 44:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum45" style="color: #606060"> 45:</span> ReadFiles(filepath, <span style="color: #006080">"*.rdl"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum46" style="color: #606060"> 46:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum47" style="color: #606060"> 47:</span> <span style="color: #008000">'Publish the report</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum48" style="color: #606060"> 48:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum49" style="color: #606060"> 49:</span> <span style="color: #008000">'PublishReport(ReportName)</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum50" style="color: #606060"> 50:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum51" style="color: #606060"> 51:</span> <span style="color: #008000">'UpdateDataSources(ReportFolder, DataSourcePath)</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum52" style="color: #606060"> 52:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum53" style="color: #606060"> 53:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum54" style="color: #606060"> 54:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum55" style="color: #606060"> 55:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum56" style="color: #606060"> 56:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum57" style="color: #606060"> 57:</span> <span style="color: #008000">'Utility for creation of folders</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum58" style="color: #606060"> 58:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum59" style="color: #606060"> 59:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Sub</span> CreateFolders(<span style="color: #0000ff">ByVal</span> folderName <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>, <span style="color: #0000ff">ByVal</span> parentPath <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>, <span style="color: #0000ff">ByVal</span> description <span style="color: #0000ff">as</span> <span style="color: #0000ff">String</span>, <span style="color: #0000ff">ByVal</span> visible <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum60" style="color: #606060"> 60:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum61" style="color: #606060"> 61:</span> Console.WriteLine()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum62" style="color: #606060"> 62:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum63" style="color: #606060"> 63:</span> Console.WriteLine(<span style="color: #006080">"Checking for Target Folders"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum64" style="color: #606060"> 64:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum65" style="color: #606060"> 65:</span> <span style="color: #008000">'CatalogItem properties</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum66" style="color: #606060"> 66:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum67" style="color: #606060"> 67:</span> <span style="color: #0000ff">Dim</span> descriptionProp <span style="color: #0000ff">as</span> <span style="color: #0000ff">new</span> [<span style="color: #0000ff">Property</span>]</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum68" style="color: #606060"> 68:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum69" style="color: #606060"> 69:</span> descriptionProp.Name = <span style="color: #006080">"Description"</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum70" style="color: #606060"> 70:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum71" style="color: #606060"> 71:</span> descriptionProp.Value= description</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum72" style="color: #606060"> 72:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum73" style="color: #606060"> 73:</span> <span style="color: #0000ff">Dim</span> visibleProp <span style="color: #0000ff">as</span> <span style="color: #0000ff">new</span> [<span style="color: #0000ff">Property</span>]</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum74" style="color: #606060"> 74:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum75" style="color: #606060"> 75:</span> visibleProp.Name = <span style="color: #006080">"Visible"</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum76" style="color: #606060"> 76:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum77" style="color: #606060"> 77:</span> visibleProp.value= visible</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum78" style="color: #606060"> 78:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum79" style="color: #606060"> 79:</span> <span style="color: #0000ff">Dim</span> props(1) <span style="color: #0000ff">as</span> [<span style="color: #0000ff">Property</span>]</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum80" style="color: #606060"> 80:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum81" style="color: #606060"> 81:</span> props(0) = descriptionProp</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum82" style="color: #606060"> 82:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum83" style="color: #606060"> 83:</span> props(1) = visibleProp</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum84" style="color: #606060"> 84:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum85" style="color: #606060"> 85:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum86" style="color: #606060"> 86:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum87" style="color: #606060"> 87:</span> rs.CreateFolder(folderName,parentPath,props)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum88" style="color: #606060"> 88:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum89" style="color: #606060"> 89:</span> Console.WriteLine(<span style="color: #006080">"Folder {0} successfully created"</span>, foldername)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum90" style="color: #606060"> 90:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum91" style="color: #606060"> 91:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">as</span> SoapException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum92" style="color: #606060"> 92:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum93" style="color: #606060"> 93:</span> <span style="color: #0000ff">If</span> goof.Message.Indexof(<span style="color: #006080">"AlreadyExists"</span>)>0 <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum94" style="color: #606060"> 94:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum95" style="color: #606060"> 95:</span> Console.WriteLine(<span style="color: #006080">"Folder {0} already exists"</span>,foldername)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum96" style="color: #606060"> 96:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum97" style="color: #606060"> 97:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum98" style="color: #606060"> 98:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum99" style="color: #606060"> 99:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum100" style="color: #606060"> 100:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum101" style="color: #606060"> 101:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum102" style="color: #606060"> 102:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum103" style="color: #606060"> 103:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum104" style="color: #606060"> 104:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum105" style="color: #606060"> 105:</span> <span style="color: #008000">'Utility for reading files from the Report Sevices Project</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum106" style="color: #606060"> 106:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum107" style="color: #606060"> 107:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">sub</span> ReadFiles(filepath <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>, fileextension <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum108" style="color: #606060"> 108:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum109" style="color: #606060"> 109:</span> Console.WriteLine()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum110" style="color: #606060"> 110:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum111" style="color: #606060"> 111:</span> Console.WriteLine(<span style="color: #006080">"Reading Files from Report Services Project"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum112" style="color: #606060"> 112:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum113" style="color: #606060"> 113:</span> <span style="color: #0000ff">Dim</span> rptdirinfo <span style="color: #0000ff">As</span> System.IO.DirectoryInfo</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum114" style="color: #606060"> 114:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum115" style="color: #606060"> 115:</span> rptdirinfo = <span style="color: #0000ff">New</span> System.IO.DirectoryInfo(filepath)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum116" style="color: #606060"> 116:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum117" style="color: #606060"> 117:</span> <span style="color: #0000ff">Dim</span> filedoc <span style="color: #0000ff">As</span> FileInfo()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum118" style="color: #606060"> 118:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum119" style="color: #606060"> 119:</span> filedoc = rptdirinfo.GetFiles(fileextension)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum120" style="color: #606060"> 120:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum121" style="color: #606060"> 121:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum122" style="color: #606060"> 122:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum123" style="color: #606060"> 123:</span> <span style="color: #0000ff">For</span> rptcount <span style="color: #0000ff">As</span> <span style="color: #0000ff">Integer</span> = 0 <span style="color: #0000ff">To</span> filedoc.Length-1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum124" style="color: #606060"> 124:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum125" style="color: #606060"> 125:</span> <span style="color: #0000ff">If</span> <span style="color: #0000ff">Not</span> filedoc(rptcount).Name.ToString.Trim.ToUpper.Contains(<span style="color: #006080">"BACKUP"</span>) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum126" style="color: #606060"> 126:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum127" style="color: #606060"> 127:</span> <span style="color: #0000ff">SELECT</span> <span style="color: #0000ff">Case</span> fileextension</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum128" style="color: #606060"> 128:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum129" style="color: #606060"> 129:</span> <span style="color: #0000ff">Case</span> <span style="color: #006080">"*.rds"</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum130" style="color: #606060"> 130:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum131" style="color: #606060"> 131:</span> CreateDataSource(filedoc(rptcount).tostring.trim)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum132" style="color: #606060"> 132:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum133" style="color: #606060"> 133:</span> <span style="color: #0000ff">Case</span> <span style="color: #006080">"*.rsd"</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum134" style="color: #606060"> 134:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum135" style="color: #606060"> 135:</span> CreateDataSet(filedoc(rptcount).tostring.trim)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum136" style="color: #606060"> 136:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum137" style="color: #606060"> 137:</span> <span style="color: #0000ff">Case</span> <span style="color: #006080">"*.rdl"</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum138" style="color: #606060"> 138:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum139" style="color: #606060"> 139:</span> PublishReport(filedoc(rptcount).tostring.trim)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum140" style="color: #606060"> 140:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum141" style="color: #606060"> 141:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Select</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum142" style="color: #606060"> 142:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum143" style="color: #606060"> 143:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum144" style="color: #606060"> 144:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum145" style="color: #606060"> 145:</span> <span style="color: #0000ff">Next</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum146" style="color: #606060"> 146:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum147" style="color: #606060"> 147:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">as</span> Exception</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum148" style="color: #606060"> 148:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum149" style="color: #606060"> 149:</span> Console.WriteLine(<span style="color: #006080">"In ReadFiles "</span> + goof.message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum150" style="color: #606060"> 150:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum151" style="color: #606060"> 151:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum152" style="color: #606060"> 152:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum153" style="color: #606060"> 153:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum154" style="color: #606060"> 154:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum155" style="color: #606060"> 155:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum156" style="color: #606060"> 156:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum157" style="color: #606060"> 157:</span> <span style="color: #008000">'Utility for Creating Shared Data Sets contained in the project</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum158" style="color: #606060"> 158:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum159" style="color: #606060"> 159:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Sub</span> CreateDataSet(<span style="color: #0000ff">ByVal</span> filename <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum160" style="color: #606060"> 160:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum161" style="color: #606060"> 161:</span> <span style="color: #0000ff">Dim</span> valstart <span style="color: #0000ff">as</span> <span style="color: #0000ff">integer</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum162" style="color: #606060"> 162:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum163" style="color: #606060"> 163:</span> <span style="color: #0000ff">Dim</span> valend <span style="color: #0000ff">as</span> <span style="color: #0000ff">integer</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum164" style="color: #606060"> 164:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum165" style="color: #606060"> 165:</span> <span style="color: #0000ff">Dim</span> DSDefinitionStr <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum166" style="color: #606060"> 166:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum167" style="color: #606060"> 167:</span> <span style="color: #0000ff">Dim</span> DataSourceName <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum168" style="color: #606060"> 168:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum169" style="color: #606060"> 169:</span> <span style="color: #0000ff">Dim</span> QueryString <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum170" style="color: #606060"> 170:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum171" style="color: #606060"> 171:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum172" style="color: #606060"> 172:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum173" style="color: #606060"> 173:</span> <span style="color: #0000ff">Dim</span> stream <span style="color: #0000ff">As</span> FileStream = File.OpenRead(filePath + <span style="color: #006080">"\"</span> + filename )</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum174" style="color: #606060"> 174:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum175" style="color: #606060"> 175:</span> definition = <span style="color: #0000ff">New</span> [<span style="color: #0000ff">Byte</span>](stream.Length-1) {}</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum176" style="color: #606060"> 176:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum177" style="color: #606060"> 177:</span> stream.Read(definition, 0, <span style="color: #0000ff">CInt</span>(stream.Length))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum178" style="color: #606060"> 178:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum179" style="color: #606060"> 179:</span> stream.Close()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum180" style="color: #606060"> 180:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum181" style="color: #606060"> 181:</span> <span style="color: #0000ff">For</span> i <span style="color: #0000ff">As</span> <span style="color: #0000ff">Integer</span> = 0 <span style="color: #0000ff">To</span> definition.Length - 1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum182" style="color: #606060"> 182:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum183" style="color: #606060"> 183:</span> DSDefinitionStr = DSDefinitionStr + Convert.ToString(Convert.ToChar(Convert.ToInt16(definition(i).ToString)))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum184" style="color: #606060"> 184:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum185" style="color: #606060"> 185:</span> <span style="color: #0000ff">Next</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum186" style="color: #606060"> 186:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum187" style="color: #606060"> 187:</span> valstart=DSDefinitionStr.ToString.Indexof(<span style="color: #006080">"<DataSourceReference>"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum188" style="color: #606060"> 188:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum189" style="color: #606060"> 189:</span> <span style="color: #0000ff">If</span> valstart > 0 <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum190" style="color: #606060"> 190:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum191" style="color: #606060"> 191:</span> valstart = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"<DataSourceReference>"</span>) + 21</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum192" style="color: #606060"> 192:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum193" style="color: #606060"> 193:</span> valend = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"</DataSourceReference>"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum194" style="color: #606060"> 194:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum195" style="color: #606060"> 195:</span> DataSourceName=DSDefinitionStr.ToString.Substring(valstart, valend - valstart)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum196" style="color: #606060"> 196:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum197" style="color: #606060"> 197:</span> Console.WriteLine(DataSourceName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum198" style="color: #606060"> 198:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum199" style="color: #606060"> 199:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum200" style="color: #606060"> 200:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum201" style="color: #606060"> 201:</span> <span style="color: #0000ff">Catch</span> e <span style="color: #0000ff">As</span> IOException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum202" style="color: #606060"> 202:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum203" style="color: #606060"> 203:</span> Console.WriteLine(e.Message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum204" style="color: #606060"> 204:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum205" style="color: #606060"> 205:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum206" style="color: #606060"> 206:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum207" style="color: #606060"> 207:</span> filename=filename.tostring.replace(<span style="color: #006080">".rsd"</span>,<span style="color: #006080">""</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum208" style="color: #606060"> 208:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum209" style="color: #606060"> 209:</span> Console.WriteLine(<span style="color: #006080">"Attempting to Deploy DataSet {0}"</span>, filename)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum210" style="color: #606060"> 210:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum211" style="color: #606060"> 211:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum212" style="color: #606060"> 212:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum213" style="color: #606060"> 213:</span> <span style="color: #0000ff">Dim</span> item <span style="color: #0000ff">as</span> CatalogItem</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum214" style="color: #606060"> 214:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum215" style="color: #606060"> 215:</span> item=rs.CreateCatalogItem(<span style="color: #006080">"DataSet"</span>,filename, <span style="color: #006080">"/"</span> + DataSetFolder, <span style="color: #0000ff">True</span>, definition, <span style="color: #0000ff">nothing</span>, warnings)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum216" style="color: #606060"> 216:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum217" style="color: #606060"> 217:</span> <span style="color: #0000ff">If</span> <span style="color: #0000ff">Not</span> (warnings <span style="color: #0000ff">Is</span> <span style="color: #0000ff">Nothing</span>) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum218" style="color: #606060"> 218:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum219" style="color: #606060"> 219:</span> <span style="color: #0000ff">Dim</span> warning <span style="color: #0000ff">As</span> Warning</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum220" style="color: #606060"> 220:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum221" style="color: #606060"> 221:</span> <span style="color: #0000ff">For</span> <span style="color: #0000ff">Each</span> warning <span style="color: #0000ff">In</span> warnings</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum222" style="color: #606060"> 222:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum223" style="color: #606060"> 223:</span> <span style="color: #0000ff">if</span> warning.message.tostring.tolower.contains(<span style="color: #006080">"refers to the shared data source"</span>) <span style="color: #0000ff">then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum224" style="color: #606060"> 224:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum225" style="color: #606060"> 225:</span> Console.WriteLine(<span style="color: #006080">"Connecting DataSet {0} to Data Source {1}"</span>,filename, DataSourceName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum226" style="color: #606060"> 226:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum227" style="color: #606060"> 227:</span> <span style="color: #0000ff">Dim</span> referenceData() <span style="color: #0000ff">as</span> ItemReferenceData = rs.GetItemReferences(<span style="color: #006080">"/"</span> + DataSetFolder + <span style="color: #006080">"/"</span> + filename,<span style="color: #006080">"DataSet"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum228" style="color: #606060"> 228:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum229" style="color: #606060"> 229:</span> <span style="color: #0000ff">Dim</span> references(0) <span style="color: #0000ff">as</span> ItemReference</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum230" style="color: #606060"> 230:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum231" style="color: #606060"> 231:</span> <span style="color: #0000ff">Dim</span> reference <span style="color: #0000ff">as</span> <span style="color: #0000ff">New</span> ItemReference()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum232" style="color: #606060"> 232:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum233" style="color: #606060"> 233:</span> <span style="color: #0000ff">Dim</span> datasourceURL = DataSourcePath + <span style="color: #006080">"/"</span> + DataSourceName</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum234" style="color: #606060"> 234:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum235" style="color: #606060"> 235:</span> reference.name=referenceData(0).Name</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum236" style="color: #606060"> 236:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum237" style="color: #606060"> 237:</span> Console.WriteLine(<span style="color: #006080">"Reference name = "</span> + reference.name)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum238" style="color: #606060"> 238:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum239" style="color: #606060"> 239:</span> reference.Reference=datasourceURL</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum240" style="color: #606060"> 240:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum241" style="color: #606060"> 241:</span> references(0)=reference</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum242" style="color: #606060"> 242:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum243" style="color: #606060"> 243:</span> rs.SetItemReferences(<span style="color: #006080">"/"</span> + DataSetFolder + <span style="color: #006080">"/"</span> + filename, references)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum244" style="color: #606060"> 244:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum245" style="color: #606060"> 245:</span> <span style="color: #0000ff">else</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum246" style="color: #606060"> 246:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum247" style="color: #606060"> 247:</span> Console.WriteLine(warning.Message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum248" style="color: #606060"> 248:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum249" style="color: #606060"> 249:</span> <span style="color: #0000ff">end</span> <span style="color: #0000ff">if</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum250" style="color: #606060"> 250:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum251" style="color: #606060"> 251:</span> <span style="color: #0000ff">Next</span> warning</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum252" style="color: #606060"> 252:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum253" style="color: #606060"> 253:</span> <span style="color: #0000ff">Else</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum254" style="color: #606060"> 254:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum255" style="color: #606060"> 255:</span> Console.WriteLine(<span style="color: #006080">"DataSet: {0} published successfully with no warnings"</span>, filename)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum256" style="color: #606060"> 256:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum257" style="color: #606060"> 257:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum258" style="color: #606060"> 258:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum259" style="color: #606060"> 259:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">as</span> SoapException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum260" style="color: #606060"> 260:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum261" style="color: #606060"> 261:</span> <span style="color: #0000ff">If</span> goof.Message.Indexof(<span style="color: #006080">"AlreadyExists"</span>)>0 <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum262" style="color: #606060"> 262:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum263" style="color: #606060"> 263:</span> Console.WriteLine(<span style="color: #006080">"The DataSet {0} already exists"</span>,fileName.ToString)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum264" style="color: #606060"> 264:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum265" style="color: #606060"> 265:</span> <span style="color: #0000ff">Else</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum266" style="color: #606060"> 266:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum267" style="color: #606060"> 267:</span> <span style="color: #0000ff">If</span> goof.Message.IndexOf(<span style="color: #006080">"published"</span>)=-1 <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum268" style="color: #606060"> 268:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum269" style="color: #606060"> 269:</span> Console.Writeline(goof.Message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum270" style="color: #606060"> 270:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum271" style="color: #606060"> 271:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum272" style="color: #606060"> 272:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum273" style="color: #606060"> 273:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum274" style="color: #606060"> 274:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum275" style="color: #606060"> 275:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum276" style="color: #606060"> 276:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum277" style="color: #606060"> 277:</span> <span style="color: #008000">'UpdateDataSetSources(filename,DataSetFolder, DataSourceFolder,DataSourceName)</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum278" style="color: #606060"> 278:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum279" style="color: #606060"> 279:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum280" style="color: #606060"> 280:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum281" style="color: #606060"> 281:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum282" style="color: #606060"> 282:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum283" style="color: #606060"> 283:</span> <span style="color: #008000">'Utility for creating Data Sources on the Server</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum284" style="color: #606060"> 284:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum285" style="color: #606060"> 285:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Sub</span> CreateDataSource(filename <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum286" style="color: #606060"> 286:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum287" style="color: #606060"> 287:</span> <span style="color: #008000">'Define the data source definition.</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum288" style="color: #606060"> 288:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum289" style="color: #606060"> 289:</span> <span style="color: #0000ff">Dim</span> dsDefinition <span style="color: #0000ff">As</span> <span style="color: #0000ff">New</span> DataSourceDefinition()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum290" style="color: #606060"> 290:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum291" style="color: #606060"> 291:</span> <span style="color: #0000ff">Dim</span> DataSourceName <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum292" style="color: #606060"> 292:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum293" style="color: #606060"> 293:</span> <span style="color: #0000ff">Dim</span> valstart <span style="color: #0000ff">As</span> <span style="color: #0000ff">Integer</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum294" style="color: #606060"> 294:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum295" style="color: #606060"> 295:</span> <span style="color: #0000ff">Dim</span> valend <span style="color: #0000ff">As</span> <span style="color: #0000ff">Integer</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum296" style="color: #606060"> 296:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum297" style="color: #606060"> 297:</span> <span style="color: #0000ff">Dim</span> ConnectionString <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum298" style="color: #606060"> 298:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum299" style="color: #606060"> 299:</span> <span style="color: #0000ff">Dim</span> Extension <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum300" style="color: #606060"> 300:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum301" style="color: #606060"> 301:</span> <span style="color: #0000ff">Dim</span> IntegratedSec <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum302" style="color: #606060"> 302:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum303" style="color: #606060"> 303:</span> <span style="color: #0000ff">Dim</span> DataSourceID <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum304" style="color: #606060"> 304:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum305" style="color: #606060"> 305:</span> <span style="color: #0000ff">Dim</span> PromptStr <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum306" style="color: #606060"> 306:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum307" style="color: #606060"> 307:</span> PromptStr=<span style="color: #006080">""</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum308" style="color: #606060"> 308:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum309" style="color: #606060"> 309:</span> <span style="color: #0000ff">Dim</span> DSDefinitionStr <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum310" style="color: #606060"> 310:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum311" style="color: #606060"> 311:</span> DSDefinitionStr = <span style="color: #006080">""</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum312" style="color: #606060"> 312:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum313" style="color: #606060"> 313:</span> DataSourceName=filename.tostring.trim.substring(0,filename.tostring.trim.length-4)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum314" style="color: #606060"> 314:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum315" style="color: #606060"> 315:</span> Console.WriteLine(<span style="color: #006080">"Attempting to Deploy Data Source {0}"</span>, DataSourceName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum316" style="color: #606060"> 316:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum317" style="color: #606060"> 317:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum318" style="color: #606060"> 318:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum319" style="color: #606060"> 319:</span> <span style="color: #0000ff">Dim</span> stream <span style="color: #0000ff">As</span> FileStream = File.OpenRead(filepath + <span style="color: #006080">"\"</span> + filename)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum320" style="color: #606060"> 320:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum321" style="color: #606060"> 321:</span> bytedefinition = <span style="color: #0000ff">New</span> [<span style="color: #0000ff">Byte</span>](stream.Length-1) {}</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum322" style="color: #606060"> 322:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum323" style="color: #606060"> 323:</span> stream.Read(bytedefinition, 0, <span style="color: #0000ff">CInt</span>(stream.Length))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum324" style="color: #606060"> 324:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum325" style="color: #606060"> 325:</span> stream.Close()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum326" style="color: #606060"> 326:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum327" style="color: #606060"> 327:</span> <span style="color: #0000ff">For</span> i <span style="color: #0000ff">As</span> <span style="color: #0000ff">Integer</span> = 0 <span style="color: #0000ff">To</span> bytedefinition.Length - 1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum328" style="color: #606060"> 328:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum329" style="color: #606060"> 329:</span> DSDefinitionStr = DSDefinitionStr + Convert.ToString(Convert.ToChar(Convert.ToInt16(bytedefinition(i).ToString)))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum330" style="color: #606060"> 330:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum331" style="color: #606060"> 331:</span> <span style="color: #0000ff">Next</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum332" style="color: #606060"> 332:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum333" style="color: #606060"> 333:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">As</span> IOException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum334" style="color: #606060"> 334:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum335" style="color: #606060"> 335:</span> Console.WriteLine(goof.Message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum336" style="color: #606060"> 336:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum337" style="color: #606060"> 337:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum338" style="color: #606060"> 338:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum339" style="color: #606060"> 339:</span> <span style="color: #0000ff">If</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"<ConnectString>"</span>) <span style="color: #0000ff">And</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"</ConnectString>"</span>) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum340" style="color: #606060"> 340:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum341" style="color: #606060"> 341:</span> valstart = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"<ConnectString>"</span>) + 15</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum342" style="color: #606060"> 342:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum343" style="color: #606060"> 343:</span> valend = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"</ConnectString>"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum344" style="color: #606060"> 344:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum345" style="color: #606060"> 345:</span> ConnectionString = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum346" style="color: #606060"> 346:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum347" style="color: #606060"> 347:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum348" style="color: #606060"> 348:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum349" style="color: #606060"> 349:</span> <span style="color: #0000ff">If</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"<Extension>"</span>) <span style="color: #0000ff">And</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"</Extension>"</span>) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum350" style="color: #606060"> 350:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum351" style="color: #606060"> 351:</span> valstart = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"<Extension>"</span>) + 11</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum352" style="color: #606060"> 352:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum353" style="color: #606060"> 353:</span> valend = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"</Extension>"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum354" style="color: #606060"> 354:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum355" style="color: #606060"> 355:</span> Extension = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum356" style="color: #606060"> 356:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum357" style="color: #606060"> 357:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum358" style="color: #606060"> 358:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum359" style="color: #606060"> 359:</span> <span style="color: #0000ff">If</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"<IntegratedSecurity>"</span>) <span style="color: #0000ff">And</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"</IntegratedSecurity>"</span>) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum360" style="color: #606060"> 360:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum361" style="color: #606060"> 361:</span> valstart = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"<IntegratedSecurity>"</span>) + 20</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum362" style="color: #606060"> 362:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum363" style="color: #606060"> 363:</span> valend = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"</IntegratedSecurity>"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum364" style="color: #606060"> 364:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum365" style="color: #606060"> 365:</span> IntegratedSec = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum366" style="color: #606060"> 366:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum367" style="color: #606060"> 367:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum368" style="color: #606060"> 368:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum369" style="color: #606060"> 369:</span> <span style="color: #0000ff">If</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"<DataSourceID>"</span>) <span style="color: #0000ff">And</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"</DataSourceID>"</span>) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum370" style="color: #606060"> 370:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum371" style="color: #606060"> 371:</span> valstart = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"<DataSourceID>"</span>) + 14</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum372" style="color: #606060"> 372:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum373" style="color: #606060"> 373:</span> valend = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"</DataSourceID>"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum374" style="color: #606060"> 374:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum375" style="color: #606060"> 375:</span> DataSourceID = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum376" style="color: #606060"> 376:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum377" style="color: #606060"> 377:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum378" style="color: #606060"> 378:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum379" style="color: #606060"> 379:</span> <span style="color: #0000ff">If</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"<Prompt>"</span>) <span style="color: #0000ff">And</span> DSDefinitionStr.ToString.Contains(<span style="color: #006080">"</Prompt>"</span>) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum380" style="color: #606060"> 380:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum381" style="color: #606060"> 381:</span> valstart = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"<Prompt>"</span>) + 8</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum382" style="color: #606060"> 382:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum383" style="color: #606060"> 383:</span> valend = DSDefinitionStr.ToString.IndexOf(<span style="color: #006080">"</Prompt>"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum384" style="color: #606060"> 384:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum385" style="color: #606060"> 385:</span> PromptStr = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum386" style="color: #606060"> 386:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum387" style="color: #606060"> 387:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum388" style="color: #606060"> 388:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum389" style="color: #606060"> 389:</span> dsdefinition.CredentialRetrieval = CredentialRetrievalEnum.Integrated</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum390" style="color: #606060"> 390:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum391" style="color: #606060"> 391:</span> dsdefinition.ConnectString = ConnectionString</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum392" style="color: #606060"> 392:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum393" style="color: #606060"> 393:</span> dsdefinition.Enabled = <span style="color: #0000ff">True</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum394" style="color: #606060"> 394:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum395" style="color: #606060"> 395:</span> dsdefinition.EnabledSpecified = <span style="color: #0000ff">True</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum396" style="color: #606060"> 396:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum397" style="color: #606060"> 397:</span> dsdefinition.Extension = extension</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum398" style="color: #606060"> 398:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum399" style="color: #606060"> 399:</span> dsdefinition.ImpersonateUser = <span style="color: #0000ff">False</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum400" style="color: #606060"> 400:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum401" style="color: #606060"> 401:</span> dsdefinition.ImpersonateUserSpecified = <span style="color: #0000ff">True</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum402" style="color: #606060"> 402:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum403" style="color: #606060"> 403:</span> <span style="color: #008000">'Use the default prompt string.</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum404" style="color: #606060"> 404:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum405" style="color: #606060"> 405:</span> <span style="color: #0000ff">If</span> PromptStr.ToString.Length=0 <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum406" style="color: #606060"> 406:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum407" style="color: #606060"> 407:</span> dsdefinition.Prompt = <span style="color: #0000ff">Nothing</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum408" style="color: #606060"> 408:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum409" style="color: #606060"> 409:</span> <span style="color: #0000ff">Else</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum410" style="color: #606060"> 410:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum411" style="color: #606060"> 411:</span> dsdefinition.Prompt = PromptStr</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum412" style="color: #606060"> 412:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum413" style="color: #606060"> 413:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">if</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum414" style="color: #606060"> 414:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum415" style="color: #606060"> 415:</span> dsdefinition.WindowsCredentials = <span style="color: #0000ff">False</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum416" style="color: #606060"> 416:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum417" style="color: #606060"> 417:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum418" style="color: #606060"> 418:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum419" style="color: #606060"> 419:</span> rs.CreateDataSource(DataSourceName, <span style="color: #006080">"/"</span> + DataSourceFolder, <span style="color: #0000ff">False</span>, dsdefinition, <span style="color: #0000ff">Nothing</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum420" style="color: #606060"> 420:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum421" style="color: #606060"> 421:</span> Console.WriteLine(<span style="color: #006080">"Data source {0} created successfully"</span>, DataSourceName.ToString)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum422" style="color: #606060"> 422:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum423" style="color: #606060"> 423:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">as</span> SoapException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum424" style="color: #606060"> 424:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum425" style="color: #606060"> 425:</span> <span style="color: #0000ff">If</span> goof.Message.Indexof(<span style="color: #006080">"AlreadyExists"</span>)>0 <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum426" style="color: #606060"> 426:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum427" style="color: #606060"> 427:</span> Console.WriteLine(<span style="color: #006080">"The Data Source name {0} already exists"</span>,DataSourceName.ToString)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum428" style="color: #606060"> 428:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum429" style="color: #606060"> 429:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum430" style="color: #606060"> 430:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum431" style="color: #606060"> 431:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum432" style="color: #606060"> 432:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum433" style="color: #606060"> 433:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum434" style="color: #606060"> 434:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum435" style="color: #606060"> 435:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum436" style="color: #606060"> 436:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum437" style="color: #606060"> 437:</span> <span style="color: #008000">'Utility to Publish the Reports</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum438" style="color: #606060"> 438:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum439" style="color: #606060"> 439:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Sub</span> PublishReport(<span style="color: #0000ff">ByVal</span> reportName <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum440" style="color: #606060"> 440:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum441" style="color: #606060"> 441:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum442" style="color: #606060"> 442:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum443" style="color: #606060"> 443:</span> <span style="color: #0000ff">Dim</span> stream <span style="color: #0000ff">As</span> FileStream = File.OpenRead(filePath + <span style="color: #006080">"\"</span> + reportName )</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum444" style="color: #606060"> 444:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum445" style="color: #606060"> 445:</span> definition = <span style="color: #0000ff">New</span> [<span style="color: #0000ff">Byte</span>](stream.Length-1) {}</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum446" style="color: #606060"> 446:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum447" style="color: #606060"> 447:</span> stream.Read(definition, 0, <span style="color: #0000ff">CInt</span>(stream.Length))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum448" style="color: #606060"> 448:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum449" style="color: #606060"> 449:</span> stream.Close()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum450" style="color: #606060"> 450:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum451" style="color: #606060"> 451:</span> <span style="color: #0000ff">Catch</span> e <span style="color: #0000ff">As</span> IOException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum452" style="color: #606060"> 452:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum453" style="color: #606060"> 453:</span> Console.WriteLine(e.Message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum454" style="color: #606060"> 454:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum455" style="color: #606060"> 455:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum456" style="color: #606060"> 456:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum457" style="color: #606060"> 457:</span> reportname=reportname.tostring.replace(<span style="color: #006080">".rdl"</span>,<span style="color: #006080">""</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum458" style="color: #606060"> 458:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum459" style="color: #606060"> 459:</span> Console.WriteLine(<span style="color: #006080">"Attempting to Deploy Report Name {0}"</span>, reportname.tostring)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum460" style="color: #606060"> 460:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum461" style="color: #606060"> 461:</span> <span style="color: #0000ff">Dim</span> item <span style="color: #0000ff">as</span> CatalogItem</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum462" style="color: #606060"> 462:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum463" style="color: #606060"> 463:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum464" style="color: #606060"> 464:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum465" style="color: #606060"> 465:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum466" style="color: #606060"> 466:</span> item=rs.CreateCatalogItem(<span style="color: #006080">"Report"</span>,reportname, <span style="color: #006080">"/"</span> + ReportFolder, <span style="color: #0000ff">True</span>, definition,<span style="color: #0000ff">nothing</span>, warnings)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum467" style="color: #606060"> 467:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum468" style="color: #606060"> 468:</span> <span style="color: #008000">'warnings = rs.CreateCatalogItem(reportName, "/" + ReportFolder, False, definition, Nothing)</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum469" style="color: #606060"> 469:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum470" style="color: #606060"> 470:</span> <span style="color: #0000ff">If</span> <span style="color: #0000ff">Not</span> (warnings <span style="color: #0000ff">Is</span> <span style="color: #0000ff">Nothing</span>) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum471" style="color: #606060"> 471:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum472" style="color: #606060"> 472:</span> <span style="color: #0000ff">If</span> item.Name <> <span style="color: #006080">""</span> <span style="color: #0000ff">then</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum473" style="color: #606060"> 473:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum474" style="color: #606060"> 474:</span> Console.WriteLine(<span style="color: #006080">"Report: {0} published successfully with warnings"</span>, reportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum475" style="color: #606060"> 475:</span> UpdateDataSources_report(reportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum476" style="color: #606060"> 476:</span> UpdateDataSet_report(reportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum477" style="color: #606060"> 477:</span> <span style="color: #0000ff">else</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum478" style="color: #606060"> 478:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum479" style="color: #606060"> 479:</span> <span style="color: #0000ff">Dim</span> warning <span style="color: #0000ff">As</span> Warning</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum480" style="color: #606060"> 480:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum481" style="color: #606060"> 481:</span> <span style="color: #0000ff">For</span> <span style="color: #0000ff">Each</span> warning <span style="color: #0000ff">In</span> warnings</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum482" style="color: #606060"> 482:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum483" style="color: #606060"> 483:</span> Console.WriteLine(warning.Message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum484" style="color: #606060"> 484:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum485" style="color: #606060"> 485:</span> <span style="color: #0000ff">Next</span> warning</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum486" style="color: #606060"> 486:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum487" style="color: #606060"> 487:</span> <span style="color: #0000ff">end</span> <span style="color: #0000ff">if</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum488" style="color: #606060"> 488:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum489" style="color: #606060"> 489:</span> <span style="color: #0000ff">Else</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum490" style="color: #606060"> 490:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum491" style="color: #606060"> 491:</span> Console.WriteLine(<span style="color: #006080">"Report: {0} published successfully with no warnings"</span>, reportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum492" style="color: #606060"> 492:</span> UpdateDataSources_report(reportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum493" style="color: #606060"> 493:</span> UpdateDataSet_report(reportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum494" style="color: #606060"> 494:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum495" style="color: #606060"> 495:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum496" style="color: #606060"> 496:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">as</span> SoapException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum497" style="color: #606060"> 497:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum498" style="color: #606060"> 498:</span> <span style="color: #0000ff">If</span> goof.Message.Indexof(<span style="color: #006080">"AlreadyExists"</span>)>0 <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum499" style="color: #606060"> 499:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum500" style="color: #606060"> 500:</span> Console.WriteLine(<span style="color: #006080">"The Report Name {0} already exists"</span>,reportName.ToString)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum501" style="color: #606060"> 501:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum502" style="color: #606060"> 502:</span> <span style="color: #0000ff">Else</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum503" style="color: #606060"> 503:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum504" style="color: #606060"> 504:</span> <span style="color: #0000ff">If</span> goof.Message.IndexOf(<span style="color: #006080">"published"</span>)=-1 <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum505" style="color: #606060"> 505:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum506" style="color: #606060"> 506:</span> Console.WriteLine(goof.Message)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum507" style="color: #606060"> 507:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum508" style="color: #606060"> 508:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum509" style="color: #606060"> 509:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum510" style="color: #606060"> 510:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum511" style="color: #606060"> 511:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum512" style="color: #606060"> 512:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum513" style="color: #606060"> 513:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum514" style="color: #606060"> 514:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum515" style="color: #606060"> 515:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum516" style="color: #606060"> 516:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum517" style="color: #606060"> 517:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum518" style="color: #606060"> 518:</span> <span style="color: #008000">'Utility to Update The Data Sources on the Server</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum519" style="color: #606060"> 519:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum520" style="color: #606060"> 520:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Sub</span> UpdateDataSources(ReportFolder <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>, DataSourcePath <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum521" style="color: #606060"> 521:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum522" style="color: #606060"> 522:</span> rs.Credentials = System.Net.CredentialCache.DefaultCredentials</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum523" style="color: #606060"> 523:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum524" style="color: #606060"> 524:</span> <span style="color: #0000ff">Dim</span> item <span style="color: #0000ff">as</span> CatalogItem</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum525" style="color: #606060"> 525:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum526" style="color: #606060"> 526:</span> <span style="color: #0000ff">Dim</span> items <span style="color: #0000ff">as</span> CatalogItem()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum527" style="color: #606060"> 527:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum528" style="color: #606060"> 528:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum529" style="color: #606060"> 529:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum530" style="color: #606060"> 530:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum531" style="color: #606060"> 531:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum532" style="color: #606060"> 532:</span> items=rs.ListChildren(<span style="color: #006080">"/"</span> + ReportFolder, <span style="color: #0000ff">False</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum533" style="color: #606060"> 533:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum534" style="color: #606060"> 534:</span> <span style="color: #0000ff">For</span> <span style="color: #0000ff">Each</span> item <span style="color: #0000ff">in</span> items</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum535" style="color: #606060"> 535:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum536" style="color: #606060"> 536:</span> <span style="color: #008000">'Console.WriteLine(" update date source called --------"+ item.Path + " -----------")</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum537" style="color: #606060"> 537:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum538" style="color: #606060"> 538:</span> <span style="color: #0000ff">If</span> item.path.Indexof(<span style="color: #006080">"rdl"</span>)>0 <span style="color: #0000ff">and</span> ReportName = <span style="color: #006080">""</span> <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum539" style="color: #606060"> 539:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum540" style="color: #606060"> 540:</span> <span style="color: #008000">'Console.WriteLine(" update date source called --------"+ item.path.Indexof("rdl").tostring() + " -----------")</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum541" style="color: #606060"> 541:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum542" style="color: #606060"> 542:</span> <span style="color: #0000ff">Dim</span> dataSources() <span style="color: #0000ff">as</span> DataSource = rs.GetItemDataSources(item.Path)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum543" style="color: #606060"> 543:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum544" style="color: #606060"> 544:</span> <span style="color: #0000ff">For</span> <span style="color: #0000ff">Each</span> ds <span style="color: #0000ff">as</span> DataSource <span style="color: #0000ff">in</span> dataSources</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum545" style="color: #606060"> 545:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum546" style="color: #606060"> 546:</span> <span style="color: #0000ff">Dim</span> sharedDs(0) <span style="color: #0000ff">as</span> DataSource</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum547" style="color: #606060"> 547:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum548" style="color: #606060"> 548:</span> sharedDs(0)=GetDataSource(DataSourcePath, ds.Name)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum549" style="color: #606060"> 549:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum550" style="color: #606060"> 550:</span> rs.SetItemDataSources(item.Path, sharedDs)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum551" style="color: #606060"> 551:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum552" style="color: #606060"> 552:</span> Console.WriteLine(<span style="color: #006080">"Set "</span> & ds.Name & <span style="color: #006080">" datasource for "</span> & item.Path & <span style="color: #006080">" report"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum553" style="color: #606060"> 553:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum554" style="color: #606060"> 554:</span> <span style="color: #008000">'end if</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum555" style="color: #606060"> 555:</span> <span style="color: #0000ff">Next</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum556" style="color: #606060"> 556:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum557" style="color: #606060"> 557:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">IF</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum558" style="color: #606060"> 558:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum559" style="color: #606060"> 559:</span> <span style="color: #0000ff">Next</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum560" style="color: #606060"> 560:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum561" style="color: #606060"> 561:</span> <span style="color: #0000ff">if</span> ReportName = <span style="color: #006080">""</span> <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum562" style="color: #606060"> 562:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum563" style="color: #606060"> 563:</span> Console.WriteLine(<span style="color: #006080">"Shared data source reference set for reports in the {0} folder."</span>, ReportFolder)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum564" style="color: #606060"> 564:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum565" style="color: #606060"> 565:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">if</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum566" style="color: #606060"> 566:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum567" style="color: #606060"> 567:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum568" style="color: #606060"> 568:</span> <span style="color: #0000ff">If</span> ReportName <> <span style="color: #006080">""</span> <span style="color: #0000ff">then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum569" style="color: #606060"> 569:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum570" style="color: #606060"> 570:</span> <span style="color: #008000">' Console.WriteLine(" " + "/" + ReportFolder + "/" + ReportName + " ------------- second update called ---------------------- ")</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum571" style="color: #606060"> 571:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum572" style="color: #606060"> 572:</span> <span style="color: #0000ff">Dim</span> dataSources() <span style="color: #0000ff">as</span> DataSource = rs.GetItemDataSources( <span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum573" style="color: #606060"> 573:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum574" style="color: #606060"> 574:</span> <span style="color: #0000ff">For</span> <span style="color: #0000ff">Each</span> ds <span style="color: #0000ff">as</span> DataSource <span style="color: #0000ff">in</span> dataSources</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum575" style="color: #606060"> 575:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum576" style="color: #606060"> 576:</span> <span style="color: #0000ff">Dim</span> sharedDs(0) <span style="color: #0000ff">as</span> DataSource</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum577" style="color: #606060"> 577:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum578" style="color: #606060"> 578:</span> sharedDs(0)=GetDataSource(DataSourcePath, ds.Name)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum579" style="color: #606060"> 579:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum580" style="color: #606060"> 580:</span> rs.SetItemDataSources(<span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName, sharedDs)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum581" style="color: #606060"> 581:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum582" style="color: #606060"> 582:</span> Console.WriteLine(<span style="color: #006080">"Set "</span> & ds.Name & <span style="color: #006080">" datasource for "</span> & <span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName & <span style="color: #006080">" report"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum583" style="color: #606060"> 583:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum584" style="color: #606060"> 584:</span> <span style="color: #008000">'end if</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum585" style="color: #606060"> 585:</span> <span style="color: #0000ff">Next</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum586" style="color: #606060"> 586:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum587" style="color: #606060"> 587:</span> Console.WriteLine(<span style="color: #006080">"All the shared data source reference set for report {0} "</span>, <span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum588" style="color: #606060"> 588:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum589" style="color: #606060"> 589:</span> <span style="color: #0000ff">end</span> <span style="color: #0000ff">if</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum590" style="color: #606060"> 590:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum591" style="color: #606060"> 591:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">As</span> SoapException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum592" style="color: #606060"> 592:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum593" style="color: #606060"> 593:</span> Console.WriteLine(goof.Detail.InnerXml.ToString())</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum594" style="color: #606060"> 594:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum595" style="color: #606060"> 595:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum596" style="color: #606060"> 596:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum597" style="color: #606060"> 597:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum598" style="color: #606060"> 598:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum599" style="color: #606060"> 599:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum600" style="color: #606060"> 600:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum601" style="color: #606060"> 601:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum602" style="color: #606060"> 602:</span> <span style="color: #008000">'Utility to Update The Data Sources on the Server</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum603" style="color: #606060"> 603:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum604" style="color: #606060"> 604:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Sub</span> UpdateDataSources_report(ReportName <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum605" style="color: #606060"> 605:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum606" style="color: #606060"> 606:</span> rs.Credentials = System.Net.CredentialCache.DefaultCredentials</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum607" style="color: #606060"> 607:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum608" style="color: #606060"> 608:</span> <span style="color: #0000ff">Dim</span> item <span style="color: #0000ff">as</span> CatalogItem</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum609" style="color: #606060"> 609:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum610" style="color: #606060"> 610:</span> <span style="color: #0000ff">Dim</span> items <span style="color: #0000ff">as</span> CatalogItem()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum611" style="color: #606060"> 611:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum612" style="color: #606060"> 612:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum613" style="color: #606060"> 613:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum614" style="color: #606060"> 614:</span> <span style="color: #008000">'If ReportName <> "" then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum615" style="color: #606060"> 615:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum616" style="color: #606060"> 616:</span> <span style="color: #008000">' Console.WriteLine(" " + "/" + ReportFolder + "/" + ReportName + " ------------- second update called ---------------------- ")</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum617" style="color: #606060"> 617:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum618" style="color: #606060"> 618:</span> <span style="color: #0000ff">Dim</span> dataSources() <span style="color: #0000ff">as</span> DataSource = rs.GetItemDataSources( <span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum619" style="color: #606060"> 619:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum620" style="color: #606060"> 620:</span> <span style="color: #0000ff">For</span> <span style="color: #0000ff">Each</span> ds <span style="color: #0000ff">as</span> DataSource <span style="color: #0000ff">in</span> dataSources</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum621" style="color: #606060"> 621:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum622" style="color: #606060"> 622:</span> <span style="color: #0000ff">Dim</span> sharedDs(0) <span style="color: #0000ff">as</span> DataSource</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum623" style="color: #606060"> 623:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum624" style="color: #606060"> 624:</span> sharedDs(0)=GetDataSource(DataSourcePath, ds.Name)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum625" style="color: #606060"> 625:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum626" style="color: #606060"> 626:</span> rs.SetItemDataSources(<span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName, sharedDs)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum627" style="color: #606060"> 627:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum628" style="color: #606060"> 628:</span> Console.WriteLine(<span style="color: #006080">"Set "</span> & ds.Name & <span style="color: #006080">" datasource for "</span> & <span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName & <span style="color: #006080">" report"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum629" style="color: #606060"> 629:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum630" style="color: #606060"> 630:</span> <span style="color: #008000">'end if</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum631" style="color: #606060"> 631:</span> <span style="color: #0000ff">Next</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum632" style="color: #606060"> 632:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum633" style="color: #606060"> 633:</span> Console.WriteLine(<span style="color: #006080">"All the shared data source reference set for report {0} "</span>, <span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum634" style="color: #606060"> 634:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum635" style="color: #606060"> 635:</span> <span style="color: #008000">'end if </span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum636" style="color: #606060"> 636:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum637" style="color: #606060"> 637:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum638" style="color: #606060"> 638:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">As</span> SoapException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum639" style="color: #606060"> 639:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum640" style="color: #606060"> 640:</span> Console.WriteLine(goof.Detail.InnerXml.ToString())</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum641" style="color: #606060"> 641:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum642" style="color: #606060"> 642:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum643" style="color: #606060"> 643:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum644" style="color: #606060"> 644:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum645" style="color: #606060"> 645:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum646" style="color: #606060"> 646:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum647" style="color: #606060"> 647:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum648" style="color: #606060"> 648:</span> <span style="color: #008000">'Utility to link The Dataset with the Report</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum649" style="color: #606060"> 649:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum650" style="color: #606060"> 650:</span> <span style="color: #0000ff">Public</span> <span style="color: #0000ff">Sub</span> UpdateDataSet_report(ReportName <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum651" style="color: #606060"> 651:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum652" style="color: #606060"> 652:</span> rs.Credentials = System.Net.CredentialCache.DefaultCredentials</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum653" style="color: #606060"> 653:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum654" style="color: #606060"> 654:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum655" style="color: #606060"> 655:</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum656" style="color: #606060"> 656:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum657" style="color: #606060"> 657:</span> <span style="color: #0000ff">Dim</span> dataSets <span style="color: #0000ff">As</span> ItemReferenceData() = rs.GetItemReferences(<span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName, <span style="color: #006080">"DataSet"</span>)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum658" style="color: #606060"> 658:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum659" style="color: #606060"> 659:</span> <span style="color: #0000ff">If</span> dataSets IsNot <span style="color: #0000ff">Nothing</span> <span style="color: #0000ff">AndAlso</span> dataSets.Length > 0 <span style="color: #0000ff">AndAlso</span> <span style="color: #0000ff">Not</span> <span style="color: #0000ff">String</span>.IsNullOrEmpty(dataSets(0).Name) <span style="color: #0000ff">Then</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum660" style="color: #606060"> 660:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum661" style="color: #606060"> 661:</span> <span style="color: #0000ff">For</span> i <span style="color: #0000ff">as</span> <span style="color: #0000ff">integer</span> = 0 <span style="color: #0000ff">to</span> dataSets.Length -1</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum662" style="color: #606060"> 662:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum663" style="color: #606060"> 663:</span> <span style="color: #0000ff">Dim</span> references(0) <span style="color: #0000ff">as</span> ItemReference</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum664" style="color: #606060"> 664:</span> <span style="color: #0000ff">Dim</span> sharedDataSet = <span style="color: #0000ff">New</span> ItemReference() </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum665" style="color: #606060"> 665:</span> sharedDataSet.Name = dataSets(i).Name</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum666" style="color: #606060"> 666:</span> Console.WriteLine(<span style="color: #006080">"Attempting to Link Dataset {0}"</span>, dataSets(i).Name)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum667" style="color: #606060"> 667:</span> sharedDataSet.Reference = <span style="color: #006080">"/"</span> + DataSetFolder + <span style="color: #006080">"/"</span> + dataSets(i).Name </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum668" style="color: #606060"> 668:</span> references(0)=sharedDataSet</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum669" style="color: #606060"> 669:</span> rs.SetItemReferences(<span style="color: #006080">"/"</span> + ReportFolder + <span style="color: #006080">"/"</span> + ReportName, references)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum670" style="color: #606060"> 670:</span> Console.WriteLine(<span style="color: #006080">"Report "</span> + ReportName + <span style="color: #006080">" Linked to data set "</span> + <span style="color: #006080">"/"</span> + DataSetFolder + <span style="color: #006080">"/"</span> + Convert.ToString(sharedDataSet.Name))</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum671" style="color: #606060"> 671:</span> <span style="color: #0000ff">Next</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum672" style="color: #606060"> 672:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum673" style="color: #606060"> 673:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum674" style="color: #606060"> 674:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum675" style="color: #606060"> 675:</span> <span style="color: #0000ff">Catch</span> goof <span style="color: #0000ff">As</span> SoapException</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum676" style="color: #606060"> 676:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum677" style="color: #606060"> 677:</span> Console.WriteLine(goof.Detail.InnerXml.ToString())</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum678" style="color: #606060"> 678:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum679" style="color: #606060"> 679:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Try</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum680" style="color: #606060"> 680:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum681" style="color: #606060"> 681:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum682" style="color: #606060"> 682:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum683" style="color: #606060"> 683:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum684" style="color: #606060"> 684:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum685" style="color: #606060"> 685:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum686" style="color: #606060"> 686:</span> <span style="color: #008000">'Function to Reference Data Sources</span></pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum687" style="color: #606060"> 687:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum688" style="color: #606060"> 688:</span> <span style="color: #0000ff">Private</span> <span style="color: #0000ff">Function</span> GetDataSource(sharedDataSourcePath <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>, dataSourceName <span style="color: #0000ff">as</span> <span style="color: #0000ff">String</span>) <span style="color: #0000ff">as</span> DataSource</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum689" style="color: #606060"> 689:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum690" style="color: #606060"> 690:</span> <span style="color: #0000ff">Dim</span> reference <span style="color: #0000ff">As</span> <span style="color: #0000ff">New</span> DataSourceReference()</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum691" style="color: #606060"> 691:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum692" style="color: #606060"> 692:</span> <span style="color: #0000ff">Dim</span> ds <span style="color: #0000ff">As</span> <span style="color: #0000ff">New</span> DataSource</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum693" style="color: #606060"> 693:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum694" style="color: #606060"> 694:</span> reference.Reference = sharedDataSourcePath & <span style="color: #006080">"/"</span> & dataSourceName</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum695" style="color: #606060"> 695:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum696" style="color: #606060"> 696:</span> ds.Item = <span style="color: #0000ff">CType</span>(reference, DataSourceDefinitionOrReference)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum697" style="color: #606060"> 697:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum698" style="color: #606060"> 698:</span> ds.Name = dataSourceName</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum699" style="color: #606060"> 699:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum700" style="color: #606060"> 700:</span> Console.WriteLine(<span style="color: #006080">"Attempting to Link Data Source {0}"</span>, ds.Name)</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum701" style="color: #606060"> 701:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum702" style="color: #606060"> 702:</span> GetDataSource=ds</pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum703" style="color: #606060"> 703:</span> </pre><!--CRLF--><pre style="border-top-style: none; overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4"><span id="lnum704" style="color: #606060"> 704:</span> <span style="color: #0000ff">End</span> <span style="color: #0000ff">Function</span></pre><!--CRLF--></div></div><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><p>Happy reading <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2UDiwdzTesE2eJ0l72qWmIxOf-VrM-mDFxC1UJe6VQz4Q_DsRtmN9AU6SwUTtmAzkfjcBlMHMl7W8iR139IZOh6fZt_RHNU2fWkxC8AO0ryqN41WQmtMwVvdKrean3TJIhX3poic1t_I/?imgmax=800"></p> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com26tag:blogger.com,1999:blog-3190166579815746224.post-17019795690242331312013-11-24T06:42:00.000-08:002017-09-17T14:05:57.146-07:00Section based headers – SSRS<div dir="ltr" style="text-align: left;" trbidi="on">
I got an interesting requirement this week. My client has requested for Claim Movement report in different currency and currency profile. He also asked whether it is possible to show exchange rate only for certain profile. I don’t want to add another column; instead I went to show an additional header only for certain currency profile<br />
Example output<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCctAJZj0fgiV7TUyWGic5ETTPg6MCEd3o8TQ7sSg3cu5tXfHJ7TTANMBeqkyFs1PZqV64_xGA0bD2XeukShptRQkUfgNSprXNxCg5mUdWzFDt3uJGk_q9rGV0yyrdJtIP1HbkHZCs2mI/s1600-h/clip_image001%25255B1%25255D.png"><img alt="clip_image001" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUmlLzA9a56nKjKkxflKV2-WxEzlMPuQp4N7S1Qxy_v55HlsEdh90FvgqHqYkJCHB75iVScF2ftjA_bIKSrksV7DBlp07-Pdf_l_8AOsy2Kkj0YBZo3lRalG9ES_Ifhu8k_S7bNAwITrE/?imgmax=800" height="122" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image001" width="676" /></a> <br />
<h2>
<span style="font-size: small;">Let us take a simple example from Adventure works to illustrate the problem</span></h2>
<b>Database:</b> AdventureWorksDW2008R2 <br />
<b>Tables:</b> FactInternetSales, DimCurrency and DimSalesTerritory <br />
<b>Scenario:</b> Report the Sale amount grouped by Territory and currency. Also show an additional header with “Test” only when the customer name is “US Dollar” <br />
Create a report with below Report Query: (Let us use the SSRS grouping) <br />
<div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;">
<pre id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: "courier new" , "courier" , monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span style="color: blue;">SELECT</span> ster.SalesTerritoryRegion RegionName
,cur.CurrencyName
, fis.SalesAmount
<span style="color: blue;">FROM</span> [dbo].[FactInternetSales] fis
<span style="color: blue;">JOIN</span> dbo.DimSalesTerritory ster <span style="color: blue;">ON</span> fis.SalesTerritoryKey = ster.SalesTerritoryKey
<span style="color: blue;">JOIN</span> dbo.DimCurrency cur <span style="color: blue;">ON</span> cur.CurrencyKey = fis.CurrencyKey</pre>
<br /></div>
<br />
Group the results based on Territory and Currency in the SSRS.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvalHU44DUsn77-MiXLz2SrUUanQQYjl22cS7W9i1TRz5tpgLuNNb1QufcOib49w3LJhajqFDl1dl596wrMKEbcKCQ1G79vEEF71LJ2ISkEYT-JsAaX1BLEyVBRRsNFxPMXj5oc9DxYZ8/s1600-h/image%25255B3%25255D.png"><img alt="image" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYP5EMtjoJDRZceyxcufQ8qATB_Hu3veg-DiK6zh1ZqpceUFe8OroQRzEFf1iQcPeNy5U39-NcOial-FeyrBid9q2F_nENzjbWAi4uJ1L4FLfE_LXVqXKzOPLXn2o0W2XnQKUpcc53Vtg/?imgmax=800" height="94" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="418" /></a><br />
Section the reports based on Territory <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOlObykreNmhpGQ1B-s1sK58XxC5sfRVBJkXtcsiGJOxqJWvUUIi57LKLdQxQX9rBPHGaDgxM8aerqEd251hnmKPT_ycZNZ3QSaELxaS_KmyrAiZng9vwq0M9cD8oesFepCWHc6Q7bNHI/s1600-h/clip_image0023.png"><img alt="clip_image002" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTg7bLPlCrQsVF1lqGeth_xfrcl-mXLBKhZLKDBP4gqmRR2sCnWjwUNns8Tm7DxaMwpOAyJA0svzp4-rKEVBcogqoTe6Z67J-m8uNbY_g4t1_FC-DE3PvuGwr-ytH_C-vAYdxBfuu7xBE/?imgmax=800" height="202" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image002" width="244" /></a> <br />
<h2>
<span style="font-size: small;">Sample view of the report </span></h2>
<br />
Page 1: <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLVjS4C2HadhIVCPhJcR3fbir2j8ZbGhN8uTfyxiHmHyrxaOnZdOXbpWRiTC9GgQgQQE7_6zsuhnExsL5rbK_JECDQwP5C8jWIpEN6bk4OpwLMQbTRGFBZlVvdsxaqaJnNYUYG7qrYaso/s1600-h/clip_image0033.png"><img alt="clip_image003" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglzfUXX6l3NLz_3cvPsIoDOl_GqwSeKERh91tWyAJnv7LaSMvpcK8GCgWs7N734zR73FTL1Xs3VBVp_EuyVxACHDrAIhj7VcKg_ND5RY2bpbq-2p78ACCHE6JiYuXidtMzPp7yCx4hqEs/?imgmax=800" height="87" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image003" width="244" /></a> <br />
Last page: <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeTCzjC_ddS0V-zDNC76YKo3AwWJf-0MxpxM2MJCFeuuYapStNA-43CToYoaluYnMPEOGRCy8eTEUnWB-lbq8dso48ri65W_s4meYC5XzfOY-SqRupCYhGL_hrC3cc0KB-e6kHCCcvOa4/s1600-h/clip_image0043.png"><img alt="clip_image004" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3SW9OF-QB05qmnH_sKYYreL0UPZkVtMQ_mJlpFk3fnr95jEyEZPaMpASRc9WX-fNymWlN7nijf3q0OANKHtTMR0I3DTLY101DpAMCXAJDhbF02CFfPCzg4R-GXwn-h3z2OBLT5X5RZR0/?imgmax=800" height="228" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image004" width="244" /></a> <br />
<h2>
<span style="font-size: small;"><b>Now we want to show an additional header just for the USDollar.</b> </span></h2>
<br />
<b></b><br />
<strong>Step1 </strong>: Insert an additional row above the currency group. <br />
<b></b><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTGl0pqBs4_SStRkzVo4cLEgpDwGYCm8B2lNjdYILv9MwLh00b84zMuvCkmi9pd0uHsI9EbJ7U9nvaqnaM4133ITp-P6I2fKZ6gIFSuiv6jj_Zrj91fhKHlhsHMVXPHrTq_ODG4jeBJis/s1600-h/clip_image0053.png"><img alt="clip_image005" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiKy8s8zEAxfkRlQZNUxebu3qSFRL289bw7_22G1Fsj4NZZxab2-ZuUx-4Paqy0PHM9HRFkhGNpsmW-fRdzCcHNkfjLetNiX63lIf8k5AfE2FZqugRk-9R590N-YerO2tbCoAbO6Z0Y5U/?imgmax=800" height="219" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image005" width="244" /></a> <br />
<strong>Step 2</strong>: Open the grouping pane in advanced mode <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGhmlMLV6BsEQhZ1zwK66WhYyElLCPK7J8pRfFdka50ykS1b1lwYB5mvBgxGbtT-5FMLwb1KbxdyXFR5YaxsLiSyjbGaLSxyDdo-ReH3gwbtfYXFq3Xb_ywdGHpmqHeWx_prMbYNiZXEQ/s1600-h/clip_image006%25255B1%25255D.png"><img alt="clip_image006" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQSJ1vYJk6Cja1E72cl9KDpq49hgjZL-AaCSCRtU7atSkBND26Vf4kXuxjepB3T9S_X-eCHpTDjmQPTTDWmSyF-oOI4wIL2w4CNoVTorC2oBUCcZnv9_n15yrePZtGUMwcj3dX_0jYiKM/?imgmax=800" height="35" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image006" width="354" /></a> <br />
<strong>Step 3</strong>: select the newly added row group column and find the static element <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQWVFwOZfDo6AgoMIDVy4pDJ2E6b1BOXXtetzfJHcDTMoLkcTy2G7DL0WqQSQNNtgLWNOMAHtgD1ZhD4M0Sz0af29JWFt2YHrlVbWYdo6MquZTKPY_6jc19lrEIGh2XWdrp4ronOK8qO0/s1600-h/clip_image0073.png"><img alt="clip_image007" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPqlCZ72MDhmH4be3UuVIOUKHscTYrQm5ULZ8K6xKwwbjYhW5h_kNHhmw0y7qObOvXaYicjr3QG7QrSfbzGzVD-ZWMrXCmXgwj3f9RobpQ2t3FeVHoV29r3-DXRN-Cu7NoodlDE5Vuo3A/?imgmax=800" height="228" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image007" width="244" /></a> <br />
<strong>Step 4</strong>: Open the properties pane of the Static element and select the visibility Criteria as shown below <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHy5jvcZBiUAlC2BYp4EfY2MhWmTRC7jEGdrgW0qX4Hgyu70uP7ESWe0zXoUCokklKpVLRuzp5-qAIj0Q33UoJUM_2-2-i741rOKQ18rYG15M4PVqn7FJggRFkW-yt-dQo9zzJZ4X9cBo/s1600-h/clip_image0093.jpg"><img alt="clip_image009" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGoebHi094voQNHTBZOEF8qOvLXtfQNFa8UtNwMGSyoUpD_RrkNnLZuT5_1mpI0ucPfH8uMFYnYGxKTgOeOFL4ObcBe2aff_It4ry0tyMch-bIvW2W8zxT0qVTS6sFMEEWtGdFNxpJDe0/?imgmax=800" height="155" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image009" width="244" /></a> <br />
Against the hidden parameter enter the below expression. This will show the row only when Currency name is US Dollar <br />
=iif(Fields!CurrencyName.Value = "US Dollar",False,True) <br />
<br />
<h2>
<span style="font-size: small;"><strong>Final Output</strong> </span></h2>
<br />
<strong>Page 1</strong>: No additional Header for the Canadian Dollar Section <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6dvrgQgGVTMHF7dRPQcFF0azsisB27JMl6J0l_4EIyveH9dmhmLMzJVbO622sknL3oZMX7v3015T8DITHirG4gCgwzL2u0yqCdiGpbRBOS6D_8oyKwrnTGf1iVFUEsmg4477BjwIbxng/s1600-h/clip_image0103.png"><img alt="clip_image010" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidQfAAWXVenhObDZ-o4fMC9_8uEnRYFGQqEtk42Vnpl8Vicn2RqqD7lu8qOxc_QKmR6fUq0XkqlvPGDzvBC7-aZkGoTHF7gNPGZby_sXKUd682bLI3CqYnGaTIgQcuoULquWOYp0qSvhA/?imgmax=800" height="89" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image010" width="244" /></a> <br />
<strong>Last Page</strong>: Us dollar with additional Test Header<br />
As you can see Headers can be shown based on sections. <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaBx2GzBudr1P0UCP3buuqHGBVyl2pESv2ty-kLSuGSvk1d3lLrvyHjaJC08G4zx6vuDYP2UD_SI_u05QZtBzUZV-9OCgxRyuc3bhkxnfYIm_-evAx-iCrfnQ8K29WLrIrxGGZ34Sqplo/s1600-h/clip_image0113.png"><img alt="clip_image011" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIEJ1QtDnaWqaBcigNQE_CvOC37fORmpuwZkUtLiNK5H0TnflGBRZvNnEt5QXYrRWVt1RB9MGQ64RldTAk7_2zpGwfp7MrjO2TncUbMZbRfRZEa7a7a1Kl_3xKs0oRQ-VMLUaEhkKIuOY/?imgmax=800" height="235" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image011" width="244" /></a> <br />
Happy Learning <img alt="Smile" class="wlEmoticon wlEmoticon-smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDg60KS6vExDewSihzwQkSvxFT7oTGepUCPJqSlTS89GK4TSS2zdR3cX5UPkeaZI8F0EbhVtawgYyYUP26iUdjn7Ipa09fpJ4pn3Ub3oZFawm0PBfo7xD2xGOb7XNelv-Rp7qPuUzUEVk/?imgmax=800" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none;" /> <br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-80901563871387237922013-10-05T10:20:00.001-07:002013-10-09T08:36:56.079-07:00MDX Where clause slicer axis – AND/OR confusion<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
This is one of the repeated question and causes confusion among the MDX developers, especially if they migrate from SQL development. Before continuing this article, it is better not to compare the MDX and SQL as this will only lead to confusion and error. <br />
<h3>
What is “where” clause in MDX?</h3>
As per MSDN “The slicer axis filters the data returned by the Multidimensional Expressions (MDX) SELECT statement, restricting the returned data so that only data intersecting with the specified members will be returned”<br />
<h3>
Does it support OR/AND syntax ?</h3>
No, not directly but can be achieved with caution<br />
<h3>
Simple example for where clause</h3>
SELECT<br />
{[Measures].[Internet Sales Amount]} ON COLUMNS<br />
,[Date].[Fiscal].[Fiscal Year] ON ROWS<br />
FROM [Adventure Works]<br />
WHERE [Product].[Subcategory].[caps] <br />
The above query will simply slice the cube for Caps sales as shown below. So in SQL term it has restricted the result set for <span style="color: #ff8000;">Subcategory = ‘caps’</span> sales. <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfOokQX5uW5MZlcnlmRzVdNMMN4UR1hIe_GtEFC7SnfK28uE2Is5ZhKlQ9JAFYM29869ke4BSu71hhe-VK5Gj3AGJHGFOQZ4p6gsKfDmmaez8SvIEJ5w0khuO7BDPdETscNtWGmnDNSUk/s1600-h/image2.png"><img alt="image" border="0" height="146" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirvljKshLClyBh17Rb7OlOnpbMyJZZF70LhZaqsONFH41TRkvVpIipcXTIZq-x4F5AupERlkBe0u3DHbQY4WKFYu58a2NN7YP6ULFdQVeQ8mgQxbPRuH_pYsAXeFLBI1voP3w2plx3z7k/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="195" /></a> <br />
Now let us also check the same data with the below query<br />
SELECT<br />
{[Measures].[Internet Sales Amount]} ON COLUMNS<br />
,{[Product].[Subcategory].Members }* {[Date].[Fiscal].[Fiscal Year]} ON ROWS<br />
FROM [Adventure Works] <br />
This will produce the complete set without slicing anything and as expected result are matching<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWmyXfslx_hAidkkGSv2BFzdOPhfOAS4gqtpCM1C0yRvYfUI4arVVqqFgQH_prOw-u1ojl_ni0yiFF5yoU52sklnM8IbWKYFA1Tc8VnUhnb58yH9gQ4hLW2biXbd8DQg_K9rZPUdUD-pk/s1600-h/image5.png"><img alt="image" border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5kSXmf7Ll2KQy4tYd7XcBmW4vIyuR4AbA8QZD28wj8GTmawNhrxBz6Vrin8_zLB93RPD8UnoPH35vcJSXQ7781jRpejbMflSjheyA8xYFjlMVH78u3lCnpH-zqx-VNcM2SwlsljbP640/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="244" /></a> <br />
<h3>
<span style="font-size: medium;">Let us imitate SQL OR clause</span> i<span style="font-size: medium;">n the slicer axis</span></h3>
What if I want the helmets sale as well as caps sale. Then in SQL world we will simply say <span style="color: #ff8040;">subcategory = ‘caps’ or Subcategory = ‘Helmet’</span><br />
In MDX world this can be achieved by using multi select in where clause. This was introduced in 2005sp1<br />
SELECT<br />
{[Measures].[Internet Sales Amount]} ON COLUMNS<br />
,[Date].[Fiscal].[Fiscal Year] ON ROWS<br />
FROM [Adventure Works]<br />
WHERE {[Product].[Subcategory].[caps]<br />
,[Product].[Subcategory].[Helmets]}<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgarbSR9w8B8Bcyd5maZ-IYYKFOBc1HvpatyWzACEq9If8y3jxxAN9Dn_cl9iM4TBYlsKkjwhT4bGaAU9_f-Xb-T9OuRTcoPyC5Huil-TGqg_7b-C8cFzzZdxr-WaCqisxyOL4NgqOiJc/s1600-h/image11.png"><img alt="image" border="0" height="146" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvBxWNJVIScKi3dLNKMa3Gky_-ojq_j1_SicgjHvDeGalVFIeXnZ6kMcFivTmslbD0jOCIAOtb7NHBSxYw3dT87nUyzy_wl_FMMi24YoVWjhbxe6ovIcX54OcgdM1mn_m67LmIuCtarNw/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="188" /></a> <br />
Now let us verify the result by running the below query with cross join <br />
SELECT<br />
{[Measures].[Internet Sales Amount]} ON COLUMNS<br />
,{[Product].[Subcategory].[caps]<br />
,[Product].[Subcategory].[Helmets]} * {[Date].[Fiscal].[Fiscal Year]} ON ROWS<br />
FROM [Adventure Works] <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXBhgJ_0k11CKomtdMRKVg8ZZr3ju5iUMUSHZ4BimQp76AlmGqZmg4iCp0tYPlsHw2CBHSatPMgBf_hpuYXUfRpgsokNjeuiIxTP7Yf8sk6n1v4cdco3-S-ZJadM6-W6uG7oHo5Ig2sho/s1600-h/image14.png"><img alt="image" border="0" height="218" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH0UYGLGrCPpeJIKAC5oK_2S6Lqnapn9KGismy6SYkaSS5R6fOf0e706Xp3b0YGwZUY4H0cvzDnOCduF8hsYiuGq2Yr9kgZO-az0sQVQ6oHAINr3-0lSMHoQuelyCCLvZ4sfWRbU64q3Q/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="239" /></a> <br />
if you sum up the caps and Helmets then you will get the results<br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 400px;"> <tbody>
<tr> <td valign="top" width="100"><span style="color: blue;">Year</span></td> <td valign="top" width="100"><span style="color: blue;">Helmets</span></td> <td valign="top" width="100"><span style="color: blue;">Caps</span></td> <td valign="top" width="100"><span style="color: blue;">Total</span></td></tr>
<tr> <td valign="top" width="100">FY2008</td> <td valign="top" width="100">215923.29</td> <td valign="top" width="100">18834.05</td> <td valign="top" width="100">234757.3</td></tr>
<tr> <td valign="top" width="100">fy2009</td> <td valign="top" width="100">9412.31</td> <td valign="top" width="100">854.05</td> <td valign="top" width="100">10266.36</td></tr>
</tbody></table>
<span style="font-size: medium;">Let us imitate SQL “AND” clause</span> i<span style="font-size: medium;">n the slicer axis</span><br />
What if want to get the Helmets UK sales alone. In SQL world we would simply say this by <span style="color: #ff8040;">subcategory = ‘caps’ and Country = ‘United Kingdom’ </span><br />
in MDX world we use the same multi select principle. Slight change in syntax as we use curved brackets to represent Tuple rather than Set . But as we are slicing by different dimension it will automatically act as AND condition. if you think about the two 2D graph, (x,y) will define a point in the space. If we mention this in words then we might say point of “x AND y” in the space<br />
SELECT<br />
{[Measures].[Internet Sales Amount]} ON COLUMNS<br />
,[Date].[Fiscal].[Fiscal Year] ON ROWS<br />
FROM [Adventure Works]<br />
WHERE([Product].[Subcategory].[Helmets]<br />
,[Geography].[Country].&[United Kingdom]) <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-LWCWoApOHj9IU0IVbf3GQSZtA9eOv20rbDHstM1ZbH4qX88n4vBuRljKDMUwVZqkBarFZ1Jn4SO_5RJxl05TPaJ5rjTZyymSPrqG0OU8MIHgQ9BHRCKTajq-xwLyFDsG7gdtkkW6_Tw/s1600-h/image23.png"><img alt="image" border="0" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBi8S99CEsP3lnFqABcwG_21CBwRM7Zzxq1Px4bCdEGe6WdZ4bo6g57IVg35me1cRJmGJMe2PFfrjGe4PUNcsW6vqfegJaq1mrBF8IngeTVpy3OsQVTezn49ZoTa4HpdGEYplSp_sY9UQ/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="198" /></a><br />
We can verify the results with Crossjoin <br />
SELECT<br />
{[Measures].[Internet Sales Amount]} ON COLUMNS<br />
,([Product].[Subcategory].[Helmets]<br />
,[Geography].[Country].&[United Kingdom]) * [Date].[Fiscal].[Fiscal Year] ON ROWS<br />
FROM [Adventure Works] <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit18QegabStXGp8IN6igNZHLRNQTO-iUmiK3FS5Q-p5mOFELW-E2_1kIltMMdDferm_pv2azf56OKSgeWtsSWrM38d2vHOhJcpRwf99hs6pXQPJRtNXi0F7y2ItslFuycCdW3vkrQg-ic/s1600-h/image26.png"><img alt="image" border="0" height="117" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie51O9LaIPWCegn53R-SHjb08goRfH_5yKVyTK4l_0tlig93ztEGScrobkxV4VsRRxTk4lOWdIVF13-cYMC3qknHrbi0Gp7K0SoGVQSa_2NECCAZdzD2JZ1nRVsM78IjK4mzPM_M2f6og/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="244" /></a><br />
<h3>
What is the Problem then? </h3>
Multi-select has it’s own disadvantage or in other words issue. The statement given above by MSDN is not entirely accurate. Please read this <a href="http://sqlblog.com/blogs/mosha/archive/2006/11/02/slicer-and-axes-interaction-in-mdx-part-1-coordinate-overwrites.aspx">blog</a> by mosha<br />
One of the main advantage of Where clause is, it sets the context for the whole query and gets evaluated well before the calculated members and other axis. But unfortunately, if you use the one of the member of slicer axis hierarchy in the where clause then it reset the context and produces wrong results.<br />
select {[Measures].[Internet Sales Amount]} ON COLUMNS <br />
,[Product].[Category].[Category].MEMBERS <br />
* {[Product].[Subcategory].[Helmets]<br />
, [Product].[Subcategory].[caps]<br />
} ON ROWS<br />
from [Adventure Works] <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiONo00wCwZAhdGjMB7CKb4J3s2Vd4D99-9QyAVUzxNmEvKKhuQFEjiSzXO5ENJMcojfmV65C8l48Hmhdd_Ps1T-DS7-2fY1Zr4HWOZ6jDYH0Uglzo1dgEdoXb3vIHtiAso5HNHXlBnllo/s1600-h/image29.png"><img alt="image" border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiA0-Bj8MZx-ymd6e6JiOe5OKHVo60TzggPRRjh_2VQ9Ff-ngJ_EMQalXb8PoCUT7RjksP_FnN4GuoE_H8PkjNPlmDLhixdISit3NZo79wFK6frAw4Q67V-Kj-OnaEBzNbwXzaiXVp3HQ/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="244" /></a> <br />
If we write the same query with slicer axis as shown below then we get wrong results<br />
SELECT<br />
{[Measures].[Internet Sales Amount]} ON COLUMNS<br />
,[Product].[Category].[Category].MEMBERS ON ROWS<br />
FROM [Adventure Works]<br />
WHERE {[Product].[Subcategory].[caps]<br />
,[Product].[Subcategory].[Helmets]<br />
} <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPSa8hELFqgElEHOEffyIKETp7TX9fhBjbFMosDhwHu-IJuPWlCDhpQ9_fiXeYWgW-HX0ycA5V4jTR7Kf4uNKZuGZm-hz6YEcq4XHYrXArsZhsN4YyVqWPj_BbkaAzDF9Vtfa_ur1TMKo/s1600-h/image32.png"><img alt="image" border="0" height="91" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_FwwK9jutoV3qMdLAPUmm6yQSaCm6oafZ4zG-Hfldak2kLGfL3Uhi3HwFeXqJKyoqTmSO5MZhWL8z5kXiuvT_5IPjILiXdBwBR6u9dV6JYSCmWL6cOZXgvtWCdsX7cu8d-eInJChqYbM/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="213" /></a> <br />
<h3>
Conclusion</h3>
MDX where clause and SQL where clause are not directly comparable. In MDX we can achieve filtering by three different ways "Where”,Subcube and “Filter” function. We need to use them based on the need and query context.<br />
I am writing another blog to compare this three function and their right usage. As of now the above issue can easily resolved by using subcube. This is the one of the reason why SSRS always uses Subcube<br />
SELECT<br />
{[Measures].[Internet Sales Amount]} ON COLUMNS<br />
,[Product].[Category].[Category].MEMBERS ON ROWS<br />
From (select {[Product].[Subcategory].[caps]<br />
,[Product].[Subcategory].[Helmets]<br />
} on columns<br />
FROM [Adventure Works])<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj1uoPz1kRH5cHvyzhd_5ar33zWuMcUjHWAT3MwGm1bxGTZfN3Nq88N3HbdcMAlDtkfNg60JVM6n-bGi6U4n0fROPtyjfdv8ecThtx3KCLmqO2jfJu5BcnwQQXqrOVOLv-JsmENmBfCGE/s1600-h/image35.png"><img alt="image" border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs7V2LT7qeRXYoryk7JluH23MaKf6hcm2DyNV8fsIvps6jPwVQwzuh3c0CbHr1X6VRW9FbZ0nbox7ZI-KAkAy-dGKoPva_T-gD-fzTkwCMKVKrWgf-N2_VNx197wG6WKiv8EdbGiXYfoU/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="214" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com9tag:blogger.com,1999:blog-3190166579815746224.post-7242218138889637852013-09-29T15:36:00.000-07:002013-11-02T15:35:04.395-07:00SSRS– Multi value parameter–Choosing predefined List<blockquote> <p> </p></blockquote> <p>I read the below wiki article from satynarayan and found it very interesting as this help in some peculiar scenarios. In SSRS, multi select can be easily allowed but sometime we want to force the combination rather then allowing all possible values . This might be due to wrong aggregated values or meaningless figures.</p> <p>let us say we have parameter with A,B,C and D values. Now we want to force the user to choose only A,B,C or A,C,D or A or B or C. </p> <p>Instead of Allowing all possible 16 combination, we want to allow only 5 predefined combination. This is very hard to achieve and often need custom code to validate the combinations. But Satyanarayan proposed a simple solution.</p> <p>Please read the below article. </p> <p>In nutshell define the combination as individual parameter values like “A,B,C” and then parse it in the SQL using XML functions.</p> <p><a href="http://social.technet.microsoft.com/wiki/contents/articles/19621.ssrs-multi-valued-parameter-as-stored-procedure-input.aspx">http://social.technet.microsoft.com/wiki/contents/articles/19621.ssrs-multi-valued-parameter-as-stored-procedure-input.aspx</a></p> <p>Happy Reading <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSPMmTbJ27NwNsWxqGPksQ5wDEshBDUB9WamvLE1nuTS04-tu8CLMHeXLrqiie8IVUG_XK2AhKmRhfXEUDWjIJcGgNW2FHxNzn3FfnMowAjiyVJ2dmwpTMYADdS_KF7E91o76_FDEjvfQ/?imgmax=800"></p> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-71823621687164782592013-09-15T08:49:00.000-07:002013-10-11T02:39:52.790-07:00Profile MDX & SQL queries from SSRS<p> </p> <p><strong>Disclaimer</strong> : I have published the article in the TechNet Wiki as well. <a href="http://social.technet.microsoft.com/wiki/contents/articles/19980.profile-mdx-and-sql-queries-from-ssrs.aspx">http://social.technet.microsoft.com/wiki/contents/articles/19980.profile-mdx-and-sql-queries-from-ssrs.aspx</a></p> <p>One of the challenging aspect of integrating MDX queries with SSRS is debugging. This is mainly because SSRS ignores the #Error messages and simply returns the empty cells. Another area of concern is parameterisation and query building. If you are using parameters for the MDX queries then even a simple mistake would be very hard to analyse without seeing the actual final query.</p> <p>E.g. <p>Check the below query I am trying to display all the descendants set in column axis and resulted in error.</p> <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"> <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">WITH</span> MEMBER MEASURES.AXISText <span style="color: #0000ff">AS</span></pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">Descendants([Geography].[Geography].currentmember,3,self_and_before)</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">SELECT</span> {[Measures].[Internet Sales Amount], MEASURES.AXISText} <span style="color: #0000ff">ON</span> COLUMNS</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ,Descendants([Geography].[Geography].[Country].&[Australia]</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ,[Geography].[Geography].[<span style="color: #0000ff">State</span> Province],self_and_after)DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME <span style="color: #0000ff">on</span> <span style="color: #0000ff">Rows</span></pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">FROM</span> [Adventure Works]</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">CELL PROPERTIES <span style="color: #0000ff">VALUE</span>,</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> BACK_COLOR</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> , FORE_COLOR</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> , FORMATTED_VALUE</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> , FORMAT_STRING</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> , FONT_NAME</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> , FONT_SIZE</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> , FONT_FLAGS</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre><!--CRLF--></div></div><br /><p><strong>SQL server management studio Output sample:<br><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/1715.SSMSoutput.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/300x0/__key/communityserver-wikis-components-files/00-00-00-00-05/1715.SSMSoutput.png"></a></strong></p><br /><p>I built a simple report on top of it and got the below result. As you can see the “#Error” has been replaced by empty cells. This is confusing isn’t it? <br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/0601.SSRSOuptut.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/400x0/__key/communityserver-wikis-components-files/00-00-00-00-05/0601.SSRSOuptut.png" width="400" height="530"></a> <br /><p>So knowing the direct SQL would have easily highlighted the issue <br /><p>Now in order to easily trace the query from SSRS follow the below steps <br /><ol></ol><br /><p> 1. Create a common Template. <br /><ol></ol><br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/4760.Template1Page.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/4760.Template1Page.png"></a> <br /><ol></ol><br /><p> 2. Select the "Query End Event" as mentioned below <br /><ol></ol><br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/4186.Template2page.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/4186.Template2page.png"></a> <br /><ol></ol><br /><p> 3. Create a new trace and make sure to use the recently created template <br /><ol></ol><br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/1452.Templateuse1.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/1452.Templateuse1.png"></a> <br /><ol></ol><br /><p> 4. Now this will trace both SSAS main Data set query and Parameter query from the SSRS in the computed form <br /><ol></ol><br /><p>E.g. For the Parameter <br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/7024.ProfilerResult.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/7024.ProfilerResult.png"></a> <br /><p>E.g. For the Main Dataset query <br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/1512.Profilerresult2.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/1512.Profilerresult2.png"></a> <br /><p><strong>Include Filters</strong> <br /><p>In real life the server will host multiple databases and even development server will get accessed by multiple team members. So it is better to customise your template based on the filters to focus on the query of your interest. <br /><p><strong></strong><br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/6131.IncludeFilter.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/6131.IncludeFilter.png"></a> <br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/8103.IncludeFilter2.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/8103.IncludeFilter2.png"></a> <br /><p><strong>Best candidate for column filters</strong> <br /><ul><br /><li>Database name <br /><ul><br /><li>If you have multiple SSAS database then use this filter to narrow it down</li></ul><br /><li>NTUsername <br /><ul><br /><li>If you using windows login or trying to access from Microsoft visual Studio then this would be your name </li></ul></li></ul><br /><ul><br /><li>Success flag <br /><ul><br /><li>This is one of my favourite. If you are receiving an error in the SSRS window and you want to investigate it. Then please set a filter to “Success like 0”</li></ul></li></ul><br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/6457.SuccessFlag.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/6457.SuccessFlag.png"></a> <br /><p><strong>Tracing queries in the SQL server database instance</strong> <br /><p><strong>Select the below events for tracing SSRS queries against SQL server instance</strong> <br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/8877.SSRSTEmplate.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/8877.SSRSTEmplate.png"></a> <br /><p><a href="http://social.technet.microsoft.com/wiki/cfs-file.ashx/__key/communityserver-wikis-components-files/00-00-00-00-05/2727.SSRSTemplate2.png"><img alt=" " src="http://social.technet.microsoft.com/wiki/resized-image.ashx/__size/550x0/__key/communityserver-wikis-components-files/00-00-00-00-05/2727.SSRSTemplate2.png"></a> <br /><p><strong>Note:</strong> Irrespective of using the Stored procedure from SSRS, RPC completed should be chosen <br /><p><strong>If you are connecting to SQL database engine instead of SSAS instance then you must use the filter to reduce the number of traces.<br>Best filter candidate</strong> <br /><ul><br /><li>Application Name <br /><ul><br /><li>If you are debugging a solution which is connecting to remote server then use “.Net SqlClient Data Provider” as your filter against Application name</li></ul><br /><li>Database name <br /><ul><br /><li>Use the name of the database against which the query has been issued</li></ul><br /><li>NTUsername <br /><ul><br /><li>If you are using windows login or trying to access from Microsoft visual Studio then this would be your name</li></ul></li></ul> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-46114312132058684782013-08-25T08:34:00.000-07:002013-11-02T08:37:39.700-07:00Tabular, Multidimensional and Powerpivot which one to go for<p> </p> <p>I came across this wonderful article in the MSDN . Between power pivot and Multidimensional the choice would be quite simple because the moment we want to build large scale DW the ideal choice would be Multidimensional SSAS cube. </p> <p>Due to the introduction of Tabular model in 2012 and it’s simplicity most of us want to move towards Tabular. I can even see lot of queries related to tabular model in the forum as most of the Mid cab and small cab companies are choosing the Tabular models now. But I would definitely suggest checking the below article as not all of them supports all the feature. The best part of this article is feature comparison.</p> <p>Before making the model decision please check this Article.</p> <p><a href="http://technet.microsoft.com/en-us/library/hh212940.aspx">http://technet.microsoft.com/en-us/library/hh212940.aspx</a> <p>Happy Reading <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTc0SjKOVX9CsMBCBqY2MdrDr49lWcI0up1fINdQX2jv7BxOMooDLcSJgta2CDoqu5AQ8lV4oYJArwMz8BHca8crjbD3Ax0-aP3wH0b-xKf4rzkw0S2z84TJ2zD4c4fgR1X1yiZnAWc1c/?imgmax=800"></p> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-30410882784173992382013-08-18T15:31:00.000-07:002013-10-31T03:40:31.658-07:00Exist vs. Existing and Auto Exist–With Measures–Part 3<p>Please read the other two parts for continuity </p> <h1><font size="5">Exist–With Measures</font></h1> <p>Most of the examples around the Existing keyword talks about the effect of Exists on Dimension . But what will happen if i use it against measure</p> <h2><font size="3"><em>Will that make any difference?</em></font></h2> <p>Existing keyword set the current context on measure calculation which is really invaluable </p> <p>Let us check the below query</p><pre class="csharpcode"><span class="kwrd">with</span> member SalesAmtAustraliaCanada <span class="kwrd">as</span><br><span class="kwrd">Aggregate</span>({[Geography].[Geography].[Country].&[Australia],<br> [Geography].[Geography].[Country].&[Canada]<br> }<br> ,[Measures].[Reseller Sales Amount]<br> )<br><span class="kwrd">select</span> {[Measures].[Reseller Sales Amount],SalesAmtAustraliaCanada} <span class="kwrd">on</span> 0,<br> [<span class="kwrd">Date</span>].[Calendar].[Calendar <span class="kwrd">Year</span>].members <span class="kwrd">on</span> 1<br><span class="kwrd">from</span> [Adventure Works]<br></pre><br><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3wq6vzmSyIU30HyN3LRZn2KZj3mmT48Qavtr-_P2zybNap8AXZSEjzX6RNDMuskdBwwLGQkKCusXTufyDZSfNKbE3CDArPaNfgvsfsOYyKydFgL33mHYWA5_XhM6vsay8o2rh3v5vDy8/s1600-h/image%25255B3%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDfvLlHps01pNqIZSjOWcAF876353SnrGZAP4Rp_n-CHdkTQG5d1eqUAA6rdXsHcYe6KVyWaEiIlZ0FC5Pg5NR-_DQ17x5uTPm-fZ5HH_tx3bxqleoX7kvz4gOrPMxIjhhkFjGIRTCLd4/?imgmax=800" width="375" height="142"></a></p><br><br /><p>As expected, the Calculated measure has summed up the sales related to Australia and Canada, which is way lower than total amount against a year.</p><br><br /><p>Let us execute the below query and get the sales against different countries </p><pre class="csharpcode"><span class="kwrd">with</span> member SalesAmtAustraliaCanada <span class="kwrd">as</span><br><span class="kwrd">Aggregate</span>({[Geography].[Geography].[Country].&[Australia],<br> [Geography].[Geography].[Country].&[Canada]<br> }<br> ,[Measures].[Reseller Sales Amount]<br> )<br><span class="kwrd">select</span> {[Measures].[Reseller Sales Amount],SalesAmtAustraliaCanada} <span class="kwrd">on</span> 0,<br> [Geography].[Geography].[Country].members <span class="kwrd">on</span> 1<br><span class="kwrd">from</span> [Adventure Works]</pre><pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIpftU5dia5JunzUwwpYon-oZ0hkNYwQpK0qT0XGXN9Nt2r2iyCgp8eiGhtuW7GGgFvzJRXB2mxJAiOC2AW_qbrzN9rmyrh3iQ5S-JARarLgFvQNNhFur6PTu05JmNv9RnIl7NXAbnrWA/s1600-h/image%25255B14%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4HdvEiiudJkZqKSh-Ivk5u7z4STIuoJv5m_afrr4-rZhI-NckhxWnWhc8wZwCUjbV8KTcra5REtjha1TgyE26YRRF3l7FKXgn0zwZ1RTj-4rQFm-hs71gQzN4VzLqDnX73KnUtwzcX1o/?imgmax=800" width="379" height="156"></a></pre><br /><p>As you can see, it displays the summed value against each country and they are same. Though theoretically this is correct, we would ideally want to get the data only against Australia and Canada for this new measure.</p><br /><h2><font size="3"><em>So what is happening here?</em></font></h2><br /><p>Calculated members doesn’t get affected by the current query context . If we need the current context then we need existing keyword</p><pre class="csharpcode"><span class="kwrd">with</span> member SalesAmtAustraliaCanada <span class="kwrd">as</span><br><span class="kwrd">Aggregate</span>(<font style="background-color: #ffff00">existing</font> {[Geography].[Geography].[Country].&[Australia],<br> [Geography].[Geography].[Country].&[Canada]<br> }<br> ,[Measures].[Reseller Sales Amount]<br> )<br><span class="kwrd">select</span> {[Measures].[Reseller Sales Amount],SalesAmtAustraliaCanada} <span class="kwrd">on</span> 0,<br> [Geography].[Geography].[Country].members <span class="kwrd">on</span> 1<br><span class="kwrd">from</span> [Adventure Works]</pre><br><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyPRXvwt912xr8EQoXSD-lvHB8sL_jK9X8JSAHFANOQZQcSi7CV2BUNAZIGWa6z149gyfjlB5DpxsVigJROdEtutMzzUh1LKu7gI6ZavE5QaGJ3fRrIlBAbdYF5HQ2YiNvh75aLISgp78/s1600-h/image%25255B18%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaCulisf9WUkR7LnV2hXpHJ9zlCfG2lMEocyelBQ9XoMh5pb_1QLweMgucUSc-rxgywfTboLl8cxgHKX60-bTkEwmOiLi_osMDHHpSdV8xIZG4864tNntUGFi071v3CPLIJUmZebDEOhM/?imgmax=800" width="361" height="172"></a></p><br><br /><h2><font size="3"><em>What will happen if we change the query back to Date dimension?</em></font></h2><pre class="csharpcode"><span class="kwrd">with</span> member SalesAmtAustraliaCanada <span class="kwrd">as</span><br><span class="kwrd">Aggregate</span>(<font style="background-color: #ffff00">existing </font>{[Geography].[Geography].[Country].&[Australia],<br> [Geography].[Geography].[Country].&[Canada]<br> }<br> ,[Measures].[Reseller Sales Amount]<br> )<br><span class="kwrd">select</span> {[Measures].[Reseller Sales Amount],SalesAmtAustraliaCanada} <span class="kwrd">on</span> 0,<br> [<span class="kwrd">Date</span>].[Calendar].[Calendar <span class="kwrd">Year</span>].members <span class="kwrd">on</span> 1<br><span class="kwrd">from</span> [Adventure Works]</pre><br><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg53X500OHdt5b3ErBtgjPfNWCZXm24vUfD7fYA7VxcjXFEd30OI8hqlSh0av1ddbn2LOxs5KEwk1QS7mmVz_dgkHR4vawBPamXI5fLsP0r6gR3-G-7YcyjJuYOhKAzLg3P_dIzD3BVObk/s1600-h/image%25255B22%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI1VfAvc3Wj-FEqpo_NDzMFHhJbCMLtTyheExJcAt-wU9oM5gj2nonR_7uBIp6BU1BFKctTzKkXTfC-aiClYyf8wcBRwv1Fu4EPMKO-jeH7HMEv1m-dwCRR_cwohyphenhyphenhE05jDAaI5WwdDSs/?imgmax=800" width="361" height="144"></a></p><br><br /><p>It produces the same result as above because in the above query the current context for Geography dimension is “All Geographies”</p><br><br /><p>let us confirm this with below query</p><pre class="csharpcode"><span class="kwrd">with</span> member SalesAmtAustraliaCanada <span class="kwrd">as</span><br><span class="kwrd">Aggregate</span>(existing {[Geography].[Geography].[Country].&[Australia],<br> [Geography].[Geography].[Country].&[Canada]<br> }<br> ,[Measures].[Reseller Sales Amount]<br> )<br>member Geographycurrenthier <span class="kwrd">as</span><br>[Geography].[Geography].membervalue<br><span class="kwrd">select</span> {[Measures].[Reseller Sales Amount],SalesAmtAustraliaCanada,Geographycurrenthier} <span class="kwrd">on</span> 0,<br> [<span class="kwrd">Date</span>].[Calendar].[Calendar <span class="kwrd">Year</span>].members <span class="kwrd">on</span> 1<br><span class="kwrd">from</span> [Adventure Works]</pre><br><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjmrxX2sXGo6PUrJpY1QNTO6CkClC8tTHFFPCBZkIXLk0HcXrHC9UJr3K_9a4XtUlYwRQcNPX5NqhyphenhyphendUAodmjKRmVYFR9cZDe6FxUU-j6VKud5k5HHdnmUy94x_DeIoDpdD6UGmeSiH-w/s1600-h/image%25255B26%25255D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAvAYdSxHIXyFAQCNPkrZ_IBaZHF3LfZMtXMjxZ5fRZEUsg_f278HvmrTDyrErDJea6Ayk5TzNNHQW4mu7PfRpeVm-a4VS3zhyphenhyphen6wnk7k_IFW6Yf7SjZ-eZSBBWbiS3khDoep1f2RrxKCs/?imgmax=800" width="367" height="110"></a></p><br><br /><p>This is very useful technique for End user reporting.</p><br><br /><p>Happy reading <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA4Y6x_iK101hNT0qAhaU-C105hTie2bTZyrjjb6mgzCfHjm_I7Hn6sDBxs61fuVLTNPRgp-WgLsbRJ_6XP_hmxTVUCiRkv1zcTY6IBmnoMYuKjh2MOBb1MVxN9tndlDon0mQjra4LZJs/?imgmax=800"></p> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-28266202396781063632013-07-14T15:25:00.000-07:002013-10-31T03:29:50.465-07:00Exist v.s Existing and Auto Exist in MDX – Part 2–Usual confusion<div style="text-align: left" dir="ltr">Please read the Part1 of the same series to get the continuity<br><br> <h1><font size="5">Usual confusions</font></h1> <ul> <li> <h2><font style="font-weight: normal" size="3">Exists and “Auto exists” are nearly same only difference is Exists function don’t display the second set .</font><font style="font-weight: normal"> </font></h2></li></ul> <blockquote> <p><span style="background-color: yellow">Actually no.</span><span style="background-color: white"> One set the context other doesn’t</span><br><br></p><pre class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0 <br> , <span class="kwrd">Exists</span>( [Product].[Subcategory].[Subcategory].Members <br> ,[Product].[Category].[Clothing] <br> )<span class="kwrd">on</span> 1<br><span class="kwrd">FROM</span> [Adventure Works] <br><span class="kwrd">where</span> [Product].[Category].[Bikes]</pre><br /><p><span style="font-family: 'Trebuchet MS'">Above query will produce no results because we are slicing by two different members(Bikes & Clothing) at the same time. But the the query allows you to use the same dimension hierarchy in both rows Axis and slicer axis. </span></p><br /><p>But the below query will produce errors, because it sets the context</p><br /><div><pre id="codeSnippet" class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0 <br> , [Product].[Subcategory].[Subcategory].Members *<br> [Product].[Category].[Clothing]<br><br> <span class="kwrd">on</span> 1<br><span class="kwrd">FROM</span> [Adventure Works] <br><span class="kwrd">where</span> [Product].[Category].&[1]</pre></div><br /><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXn3xr4K38ezUjUT6qzec-kEv86QWYpWxqvaB9rfHcAj7KOZOckEcd_tQCIyVdQxnLfB6pierwHqaPg7NpfOBnPGn3jlQn8uh8HZE7n5J-VaBRNKG1Yd0HiG5AisY6L4b5lkERd6dOeXU/s1600-h/image_thumb222.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[22]" border="0" alt="image_thumb[22]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6ypth4oo4UZIive3ofEgJkXYAqaomG1308-wcNiXv8EXNMuhg9lM8mH1plkYnG20G1p51D09dTKr0NIGAc_DDRiX_6CeU0VGOcW0Ax6_BPCGySJykcwjpLFyibhBZ7KnHInsBr_98egw/?imgmax=800" width="419" height="99"></a></div></blockquote><br /><ul><br /><li><br /><h2><font size="3"><font style="font-weight: normal">Existing keyword is just an extension of Exists, we can achieve the similar results with exist and currentmember function </font></font></h2></li></ul><br /><blockquote><br /><p><span style="background-color: yellow"><span style="background-color: white"><span style="background-color: yellow">Yes,</span> But use of existing will improve the maintain</span></span><span style="background-color: white">ability of code</span></p><br /><p>Both the below codes will produce the same results</p><br /><div><pre class="csharpcode"><span class="kwrd">with</span> member countofsubcategory <span class="kwrd">as</span> <br> <span class="kwrd">count</span>( existing [Product].[Subcategory].[Subcategory].Members)<br><span class="kwrd">SELECT</span> {[Measures].[Reseller Sales Amount], countofsubcategory} <span class="kwrd">ON</span> 0<br> , [Product].[Category].[Category].Members <br> <span class="kwrd">on</span> 1<br><span class="kwrd">from</span> [Adventure Works] <br><br><span class="kwrd">with</span> member countofsubcategory <span class="kwrd">as</span> <br> <span class="kwrd">count</span>( <span class="kwrd">exists</span>( [Product].[Subcategory].[Subcategory].Members<br> ,[Product].[Category].currentmember ))<br><span class="kwrd">SELECT</span> {[Measures].[Reseller Sales Amount], countofsubcategory} <span class="kwrd">ON</span> 0<br> , [Product].[Category].[Category].Members <br> <span class="kwrd">on</span> 1<br><span class="kwrd">from</span> [Adventure Works] </pre></div><pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh73VhHnYSrjmu53XuSPpwh6MDt24RsYCzPA0kDY0Ec9mJtOkVFn9bDylfitUrpDSI_yBJi6E6vxXTc2XIMX_hp5vorfKovUSbFsGAukkAmnVn1RDW6icNzPFr-EOEJOHy5jMUr2oq2MZk/s1600-h/image3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUmv4_PLjtVeBCNs_bRpLTEEdP8ZoJHJW59UWJb8F9sfK0xf7ComUZGy8kMB7osJAww91XD5lYDD1MwJIwURhoQAtBmEwPY0Pv9IF46qcKPKTLriF9uofFsG6J18YS5dbH-FnnjKAKWPY/?imgmax=800" width="306" height="113"></a></pre></blockquote><br /><ul><br /><li><span style="font-size: small"><br /><h2><font size="3"><font style="font-weight: normal">DO we have not exists function ?</font></font></h2></span></li></ul><br /><blockquote><br /><div><span style="background-color: yellow">No.</span> But this can be simulated with except function</div></blockquote><br /><blockquote><br /><div>The below query produces 8 rows of data</div></blockquote><br /><blockquote><br /><div id="codeSnippetWrapper"><pre class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0 <br> , <span class="kwrd">Exists</span>( [Product].[Subcategory].[Subcategory].Members , <br> [Product].[Category].[Clothing]<br> ) <br><br> <span class="kwrd">on</span> 1<br><span class="kwrd">FROM</span> [Adventure Works] </pre><pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtNYVPeqvSuKdescLmuZANYjtUqLqCxqxJNLmQZYtMJZaQKgZgtEVCBjGBzL-inll_P46Qaezu99vAmOWkB_-5mYTxVB4KB_At-e8U9qT0DwsSDlXiE7rBn-69x6gmXw2B-qWU1l8yqHc/s1600-h/image6.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitRvBLJhjTFMM2y0cokg2dLy19-Vvip6TDMKHovSSeK2KJAbjtBUzV_4GItbBGADZwA4RbgLCkJ18-P0A30YWrHoOaEA4xFQd1apIcCc0lEnVomVEzcG2bPm5GW7ioYGAE5mdhRXUvBVo/?imgmax=800" width="191" height="179"></a> </pre></div></blockquote><br /><blockquote><br /><div id="codeSnippetWrapper"><pre class="csharpcode">With the except function in the below query it produces the opposite set with 30 rows </pre></div></blockquote><br /><blockquote><br /><div id="codeSnippetWrapper"><pre id="codeSnippet" class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0 <br> ,<span class="kwrd">EXCEPT</span>([Product].[Subcategory].[Subcategory].Members,<br> <span class="kwrd">Exists</span>( [Product].[Subcategory].[Subcategory].Members , <br> [Product].[Category].[Clothing]<br> ) <br> )<br> <span class="kwrd">on</span> 1<br><span class="kwrd">FROM</span> [Adventure Works] </pre></div><br /><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw0neVX5I3-7woPCzs0zc1VtY6Xzp1v_BRxCSjy2NTh1xaO8MvlIry8c6Tl97bhGuDUF6lvfmOH7Vcn-Pr1cKt1sDjqectIJzqpfeKX1E76zUDPBLY81RbuvpLoN-YERyg5m-wdL-3Djc/s1600-h/image_thumb242.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[24]" border="0" alt="image_thumb[24]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJhsxIWng-ZzzrylLhAMZDOATiUH1D5PQLVGtLU23d0e9Ou2KrkO4pZPEm2yFJvuH1-wk6-QcMVEYdOOr7_NykdMtOIswe4878cyc72lpPaSuMrPfZN48I-wtGdSOnwZ4r9DJO7QyssKM/?imgmax=800" width="281" height="234"></a></div><br /><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyE06uV8IeKYDEJu_j56RWoif305UJjc_JPrd4wggXfRE13o2PN-cbOQbjvlILzeC4dqzBHO3esSJrTlE4-fMAkAj3n9vNHz8TId890hycIqFuFTXN2ArCYOm9M9pts_93veJmv4qj_vk/s1600-h/image_thumb262.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[26]" border="0" alt="image_thumb[26]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKoQLJI3VD3vcjXRoofCyYJOcws7rdB3sG4MVR5CWdUR-tQoZyi0NkJxonBunHvQpcHco9ezQ8PuCVIlU_IMjdz7NEM84VJA6zWGRCxru6gqZ7dxSUD4A8LLtUWarIUV3HQy0XCcn4z5w/?imgmax=800" width="397" height="89"></a></div></blockquote><br /><ul><br /><li><br /><h2><font size="3"><font style="font-weight: normal">Generate function forces it’s own context against existing keyword</font></font></h2></li></ul><br /><blockquote><br /><div>Check the below query. It is clear that existing keyword uses the generate function’s context and that is why we got 3 subcategory against all category in the result set</div></blockquote><br /><blockquote><pre id="codeSnippet" class="csharpcode"><span class="kwrd">with</span> member countofsubcategory <span class="kwrd">as</span> <br>Generate ([Product].[Category].[Bikes]<br> , <span class="kwrd">count</span>( <span style="color: blue">existing</span> [Product].[Subcategory].[Subcategory].Members)<br> )<br><span class="kwrd">SELECT</span> {[Measures].[Reseller Sales Amount], countofsubcategory} <span class="kwrd">ON</span> 0<br> , [Product].[Category].[Category].Members <br> <span class="kwrd">on</span> 1<br><span class="kwrd">from</span> [Adventure Works] </pre><br /><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyttpm1vX3Nias-ZUmmV_nzOzJ7Btg7tdNmVQ8sJW-hUHaqvZabdqJ5IpdYN9lfIewJ8aPGAkmEdEOgQbLVvoUfoM_qYSFmpVvHWKlF6ML7qQPYWwLxi3SJTaOizpjBaxeEtcBX37mFWs/s1600-h/image_thumb282.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[28]" border="0" alt="image_thumb[28]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWursVyyiZ8QkNn_XhSGOxeTulll9dtsHA1cdTiKdujByIebn4tK4CvZyKTGOOkY7mYrktV0eIAY-hBPFE4IvT5XYfsSYzPGKywdKFoiQqzzAZ950jlthEAztjBQ3PxJIafJfvZ2ebAKg/?imgmax=800" width="384" height="132"></a></div><br /><div> </div><br /><div>This is an another proof that existing keyword is simply an extension of Exists function</div></blockquote><br /><p>Happy Reading <img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix_bqvQ5dZja3CkyVee9VNDLxOA7CRdEPaRB5rZFZYCy7C0sVd3y7QJb0Qg2nwVdyjwBrQ_Ag84va6oDgdGvw6oacfJ5JgebB862yCPspLTt71ECrNJV8UrS79dkqH2OzPVuTFSoZ2poE/?imgmax=800"></p></div> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-38424550255348148942013-07-07T15:37:00.000-07:002013-10-20T02:59:35.148-07:00Exist v.s Existing and Auto Exist in MDX – Part 1<div dir="ltr" style="text-align: left;">Though Exist, existing and Auto exist are conceptually very simple, they are the root cause for many confusion in the complex MDX queries. So let us do a simple comparisons <br /><br /><table border="2" width="792" cellspacing="0" cellpadding="2"><tbody><tr><td valign="top" width="81"> </td><td valign="top" width="133"><p><span style="color: #0000ff;">Normal Behaviour</span></p></td><td valign="top" width="234"><p><span style="color: #0000ff;">Auto Exists</span></p></td><td valign="top" width="168"><p><span style="color: #0000ff;">Exists</span></p></td><td valign="top" width="177"><span style="color: #0000ff;">Existing </span></td></tr><tr><td valign="top" width="88">Theory</td><td valign="top" width="140"><p>When the two sets are cross joined it will produce all possible combination. E.g. if we join two sets with 4 dimension each then it will produce 16 members</p></td><td valign="top" width="238"><p>It forces the natural hierarchy in the below Scenarios</p><p><br />When two sets containing members of the same dimension are cross-joined, the resulting set is limited to those combinations of members actually observed in that dimension. <br />When the WHERE<br />clause contains a member of a dimension, sets along the axes containing members from that same dimension are limited as well.</p></td><td valign="top" width="168"><p>It forces the natural hierarchy with out returning the forcing/second set</p></td><td valign="top" width="177"><p>Auto exist is not applicable to calculated members and if we want to force this behaviour then we need existing keyword</p></td></tr><tr><td valign="top" width="92">When to use</td><td valign="top" width="143">When we want to display the measures based on two different dimension</td><td valign="top" width="235">When we want to display the measures based on the members in different level from same hierarchy</td><td valign="top" width="168">Achieve the same Auto exists results with out displaying second Dimension</td><td valign="top" width="177">Forces the <span style="background-color: #ffff00;"><span style="background-color: #ffffff;">local </span></span>context in the calculated members</td></tr></tbody></table><h3>Normal Behaviour</h3><p>Run the below query</p><pre class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0<br /> , [Product].[Category].[Category].Members <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works] </pre><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTd40kig414UkoO_A7-bxMqk0Qx_CMr6qqzq3G8Yl88aUahPOyTE7P627RXxjiVK6BzMlQ0t4flxE2-lsenjf28xOHCqkLr7R4-XZydb3NM-xxSF5TTwNEfJGq8EbppQwCRNDc7CiujUE/s1600-h/image2.png"><img style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc_lrS62JVffcA_C4BoL8WwU64QtEq8sb__ZB6sAiNzGLEHK8jWgNeED-JFLqbHAb8D330p4YJBpV8LoNoIoaAzLRPrc-KJA61ph9YJMeDAkEVkvbEkH0aA1FZOvceNJ5B7mmyOcS4FW8/?imgmax=800" alt="image" width="202" height="102" border="0" /></a></p><p>Based on the above query we have 4 Categories in the Product Categories Hierarchy<br /><br /></p><pre class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0<br /> , [Geography].[Geography].[Country].members<br /> <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works] </pre><pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0cOQaFriunMyj_30RedD8J1laDwbRkrFuj41QgUPtw3SZej2oKP0nkn9l6dc61ZhlhxRq-NK5t2b6UAw9TZTXrjEGpTxvVZMTLMhBSz5nymz1SStJlMBdX44edbvYuXjAL9ITDi0YGMs/s1600-h/image5.png"><img style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_u0dhEyLIY8paLE3gE7pQLSKBK4VNOuMSjMFNsyX-WdU6kmR_s5l1h3HRUNhHz4EKD_0iGjsGVDofrny0XCKoWshyPf2tgsHoVY2SF0wBfkUPyt5KsSftCguyONLA9cZSuw5KgGGKnso/?imgmax=800" alt="image" width="218" height="136" border="0" /></a></pre><p>Based on the above query we have 6 countries under geography hierarchy </p><h3>Let us Cross Join it</h3><pre class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0<br /> ,[Product].[Category].[Category].Members <br /> * {[Geography].[Geography].[Country].Members<br /> } <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works]</pre><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3aHJFSFkoHjUNp8bnLcpyjQ2NT9T1DbbaAtEq2Z51tJNdJ5ZlCd09DtiqvsF-EW08tzdCFTNvi5HX_3m-EdaNtTPLEhtWT1khZ4M3pxPoU9f3MWQS74Fj82Qj4fwgFoH2sBHoPq7ezg0/s1600-h/image13.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHwbXfUw5lactrYASDtwwIiNMuV1wN4w99PEnHB0kCMyGnvk8oVAlYgR6MmL1ZYR6cMIUlH3Nprt3wYXSL6YS6JMaQWw7-Quf_mGVnPAaPWas9IoZTF4bleTtyzVMHtGd5CrWnEHUMKV0/?imgmax=800" alt="image" width="378" height="258" border="0" /></a></p><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggc9YE6Pw5thqQhzlz4RUdECXRePgFrQv6DOVMkVbpiPpQZchJvb3BzME0ZfDI8HExJKgLkdiYrFbqzU81lbizj0VJu5nvPJ-qUQ3TjadJu_rWJg7O1mv33pKLMghN9FYHhFEst72vrL0/s1600-h/image9.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdkUOwXvZFacqsYr8EUXeL5xR2xY5DyQUWqapEpGRi9h3COMdJKuthHEooh8nSxikkBm-DAvnZupCyofkkn9m957TFWDleVP5G66RVC5kR8CNckFljgEEYqq_bDxcxSWWANCVwpvC1Apg/?imgmax=800" alt="image" width="518" height="115" border="0" /></a></p><p>So along with the header row it has returned 25 rows which is direct cross product of 4 Products and 6 countries (24 data row + 1 Header row)<br /><br /></p><h3>What other ways to achieve the cross join</h3><p>You can use the cross join function as shown below<br /><br /></p><pre class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0<br /> ,crossjoin ([Product].[Category].[Category].Members <br /> , [Geography].[Geography].[Country].Members<br /> ) <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works] </pre><p><span style="background-color: yellow;">Even if you remove the Crossjoin keyword in the above query, it will still produce the same result .</span> </p><div> </div><div><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0<br /> ,([Product].[Category].[Category].Members <br />, [Geography].[Geography].[Country].Members<br /> ) <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works]</div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwYg1NBJG-3hBat0nyeXL2HCtfekTih7ZtnVR3JKJe7uRAHYPp9dB3R94flXCyZ3_PTGO86Jlp2Uueuq8f_8XS7LdRfMZwhCDbgmZpjAe4aLmqJ_8Pdrlov4cpNCJvFZe0Z0VP74RjZ4U/s1600-h/image17.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6G17O0n6qawZHhm78dtmfueWnNMgOn_F3pAw23XOEPkldBPncNm0CUVzBLxIlg3VSEVJOw9UhWAx_EwLRH4MGOBJZgGKYaO2r5Ukv9OKtaS-w2HArMZ7qyFNW1K7HlBo5UfcrtRMZFIQ/?imgmax=800" alt="image" width="434" height="88" border="0" /></a></div><div> The reason is MDX will try to resolve the other dimensions of the cube for every combination (remember the partial tuple law)and will get you the cross join.</div><h3>Auto Exists</h3><p>In the above example we have used the cross join between two different hierarchies (Product.category and geography.country). let us join between category and sub category from same product hierarchy.</p><p>Step 1: Let us find the count of subcategory first</p><div><pre class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0<br /> , [Product].[SubCategory].[SubCategory].Members <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works] </pre></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfzWtmq0iGXUW_zNgwICuX8jI2cuCRxO5ZpVVi4WiXMzMngaCE3BGR6z1Yd688w5M4cgu7Yc176RArk8waeYt8WNvYpu2Or08BWBmvj4jfuGt273xPAHB4zs-H8XeuqsVE8kGxuKoQm1E/s1600-h/image21.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-6vQamRHY-iyGyYcZc_fddj0pLzrzTuM8fIDfC2HLso3hY6XeY6UEJVCDDiy_j62tdFj9XAPC2YdHWnnJdhGS9UrYhxAAknhLwRSEXv7PO9ZTzHaoD2iqhN2REEBK-jnpJf6m59iPAeg/?imgmax=800" alt="image" width="422" height="88" border="0" /></a></div><div> Along with header row we have 38 subcategories, let us cross join subcategory and category.</div><p> </p><div id="codeSnippetWrapper"><pre id="codeSnippet" class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0<br /> , [Product].[Category].[Category].Members *<br /> [Product].[Subcategory].[Subcategory].Members <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works] </pre><pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2Dl7svRpO-w_m-TEOT1Z8H7UJMSS0RHbFgWMJ5BIsWwgYSII4ke063q9Vn39bRckhHhTOJqHcF1HCiw3d3n-c2sjhx47ztwbRDtvPOsWhV6VDB8AVX8q3VK7789ie2IV3TeEV-vx4-KU/s1600-h/image25.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf3kwdqeDuHce-98WkSWoq8j6GS7M4CwMAOVXSMUYnsSNPcy1uGCVXb7P5VY6x0W3vXopGxeGwL6mJc355V_ihVyYZuPYrhXvbZ-XxZxJC1DEK2sQT5qUtdwAsMJ0-iRcfne1N_VTnVtI/?imgmax=800" alt="image" width="281" height="293" border="0" /></a></pre><pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI0Xy0mrKliFZSEuYzB7psnAuW8hAaEf5-GCkuila5iXr_Axl6QEUTbTphRV84K-T_PXFRdYkV6Kj0a8Hr-69SYj1Qmk4_sAtIPpLToPL3FeOSADaJGbETdnqsxavIK5ErtuEgAQZ3ZH0/s1600-h/image30.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6vbGqEPtQd2hsL8lrAgndvPw2Gv9bzost9YwHOaIy4t4vRv5cGr7IYTOiHoD-DyjexbEwjABdNkcpmEt9SfCYL1CSsx0i1Q-D7LEsOmkL94rz4BpKlEaqs11HRhAa1bkGCcEfmOfvRMc/?imgmax=800" alt="image" width="396" height="105" border="0" /></a></pre><p>As you can see from the output though it has given the cross product, it still only has the same 38 (37 rows of data + 1 header) rows in the output. as per the normal behaviour it should be 4*38 = 152</p></div><div>The reason is, based on the Product category hierarchy, only valid category and Subcategory combinations are produced. </div><p> </p><h3>What is Existing </h3><div>Let us create a calculated member in the above query</div><div><pre id="codeSnippet" class="csharpcode"><span class="kwrd">with</span> member countofsubcategory <span class="kwrd">as</span> <br /> <span class="kwrd">count</span>( [Product].[Subcategory].[Subcategory].Members)<br /><span class="kwrd">SELECT</span> {[Measures].[Reseller Sales Amount], countofsubcategory} <span class="kwrd">ON</span> 0<br /> , [Product].[Category].[Category].Members *<br /> [Product].[Subcategory].[Subcategory].Members<br /> <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works] </pre></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb7HDAjFC_nR39joA_iDWZMc9eLWiFCt6tpOKvMP-vFsHQwekIFRJzyd311aX-mT3Fk6PTjBaMHMVnM4fc5wAlbZBnktTE5-IZRdodtR9PBYeXlxHbUCHTPZXB32_w5PygHY0xTulz6Kc/s1600-h/image34.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="http://lh3.ggpht.com/-yLHgupMwI70/UmMIPpvtJSI/AAAAAAAADzM/ypMMTcz1j-Q/image_thumb16.png?imgmax=800" alt="image" width="335" height="261" border="0" /></a> </div><div>Though we are displaying each subcategory in the list, still we got the total count . This is because Auto exist doesn’t control the calculated members </div><div> </div><div>So by inserting Existing keyword in the above query,it will produce the expected result which 1 per subcategory</div><div id="codeSnippetWrapper"><pre id="codeSnippet" class="csharpcode"><span class="kwrd">with</span> member countofsubcategory <span class="kwrd">as</span> <br /> <span class="kwrd">count</span>( existing [Product].[Subcategory].[Subcategory].Members)<br /><span class="kwrd">SELECT</span> {[Measures].[Reseller Sales Amount], countofsubcategory} <span class="kwrd">ON</span> 0<br /> , [Product].[Category].[Category].Members *<br /> [Product].[Subcategory].[Subcategory].Members<br /> <span class="kwrd">on</span> 1<br /><span class="kwrd">from</span> [Adventure Works] </pre></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnXIV8RPleWWwClEAEMyBtwiNdyX0G40zAPI1zy0aq5_-hlK6DFrykr2cJuJANvtRD-ahiU0sa6ZxNXJgbxgD72fkGJMb8XmkvBZ-yjgwFqg81j73VJnYsagp9Bm-LZBJ0rMweREGxpug/s1600-h/image38.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAN39JjtrKLN5unkxCLPubxDJDmp_H-GHOkQgSTuchlqxrwFuAJbchuoccCSHI6usembFTj0TVX2QfYCMrC9Z9gixAsfu5TSOyZao3qx1c9LieDjXzpDwpP5gFWZY4TvD1p9OuC5LUlF0/?imgmax=800" alt="image" width="392" height="301" border="0" /></a></div><p> </p><h3>What is Exists function ?</h3><p>Exists uses the “Auto exist” functionality but avoid displaying the “second set” in the results<br /><br /></p><div id="codeSnippetWrapper"><pre id="codeSnippet" class="csharpcode"><span class="kwrd">SELECT</span> [Measures].[Reseller Sales Amount] <span class="kwrd">ON</span> 0 <br /> , <span class="kwrd">Exists</span>( [Product].[Subcategory].[Subcategory].Members , <br /> [Product].[Category].[Clothing]<br /> ) <br /> <span class="kwrd">on</span> 1<br /><span class="kwrd">FROM</span> [Adventure Works] </pre><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKmu_drnIvVHQAEqp66AT_v4Zxb8_1HdL_W37HhTK3o69I3_SGA-j6LpdRI6rKFAnlD5Rd74aDy4IZLM3pNE9rdY3i2Y7VkLWC9qeT-URfuuJRteRWAXp6s60K3_Owqkmm2pVd1G1FC9I/s1600-h/image42.png"><img style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK0JWUVIknTI2iYQQqGFMHJ3xAoOuku8dQH6gK00hC6fgk-7u-a2mAP4v4KaXOtzFyMyhA7Di6V2yLm_PxTTgjOGxN2KPXMrSgLnyge6sRHdhmxC5rat2hePTJHSKaohHr_2Lmd7UnAKU/?imgmax=800" alt="image" width="249" height="226" border="0" /></a></p><p>It only displays the subcategories which are related to Clothing category without displaying category in the result.</p></div></div>Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-71664515217171135162013-06-25T14:35:00.000-07:002014-03-09T03:42:04.135-07:00Step By step Guide to integrate SQL management studio with Subversion<div style="text-align: left" dir="ltr" trbidi="on"> <div class="separator" style="text-align: center; clear: both"> </div> <div class="MsoNormal">If you have worked in .net and migrated to database like me then you will surely miss the free add-ins for subversion (<span style="font-size: 10.5pt; font-family: "Arial","sans-serif"; background: white; color: #009933; line-height: 115%">ankhsvn)</span>. As more and more companies are moving towards the open source versioning system like subversion, it is really painful that Microsoft SSMS studio doesn't have any add-in for subversion.<o:p></o:p></div> <div class="MsoNormal"> </div> <div class="MsoNormal">There is a neat and simple solution available from Redgate but it requires license for each PC so if you are working in a place where purchase decisions are difficult to come by then this solution can be very handy. <o:p></o:p></div> <div class="separator" style="text-align: center; clear: both"></div> <div class="MsoNormal"> </div> <div class="MsoNormal">Required: TortoiseSVN in your local machine and write access to subversion repository <o:p></o:p></div> <div class="MsoNormal"> </div> <div class="MsoNormal"><b>Create or Check out an existing solution</b></div> <div class="MsoListParagraphCxSpFirst" style="text-indent: -18pt; mso-list: l4 level1 lfo1"><span style="font-size: 7pt"> </span></div> <div class="MsoListParagraphCxSpFirst" style="text-indent: -18pt; mso-list: l4 level1 lfo1"><o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; text-indent: -18pt; mso-list: l0 level1 lfo2; mso-add-space: auto"><span style="font-family: symbol">·</span><span style="font-size: 7pt"> </span>Decide and create a working folder in C: (You can use other drives but Avoid Network drives)<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 108pt; text-indent: -18pt; mso-list: l0 level2 lfo2; mso-add-space: auto"><!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New"">o<span style="font-size: 7pt; font-family: 'Times New Roman'"> </span></span><!--[endif]-->Ex. “C:\Test Project”<o:p></o:p></div> <div class="MsoListParagraphCxSpLast" style="margin-left: 72pt; text-indent: -18pt; mso-list: l0 level1 lfo2; mso-add-space: auto"><span style="font-family: symbol">·</span><span style="font-size: 7pt"> </span><span style="font-size: 7pt"> </span>Create a folder in the Subversion repository <o:p></o:p></div> <div class="MsoListParagraphCxSpLast" style="margin-left: 72pt; text-indent: -18pt; mso-list: l0 level1 lfo2; mso-add-space: auto"><a style="text-align: center; margin-left: 1em; margin-right: 1em; text-indent: 0px" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU8UrHtE8U1RGYedBlCzV7bEe0x4Hwn4blGMzMYzW-TjL3V75_uVqJ4rBTbaROde_6abGWNPvJY1fg_UuNTLRQPQ3cyQYnsGGVlD3gWBN1ZOlr19Kp1UtYeSX8sFD9IfK78f0p7O1rpNk/s1600/image001.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU8UrHtE8U1RGYedBlCzV7bEe0x4Hwn4blGMzMYzW-TjL3V75_uVqJ4rBTbaROde_6abGWNPvJY1fg_UuNTLRQPQ3cyQYnsGGVlD3gWBN1ZOlr19Kp1UtYeSX8sFD9IfK78f0p7O1rpNk/s320/image001.png" width="239" height="320"></a></div> <div class="MsoNormal" style="text-indent: 36pt"> </div> <div class="separator" style="text-align: center; clear: both"> </div><o:p></o:p><br> <div class="MsoListParagraphCxSpFirst" style="margin-left: 72pt; text-indent: -18pt; mso-list: l2 level1 lfo3; mso-add-space: auto"><!--[if !supportLists]--><span style="font-family: symbol; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol">·<span style="font-size: 7pt; font-family: 'Times New Roman'"> </span></span>Right click on the newly created folder and Integrate it with your work folder using the checkout option<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; mso-add-space: auto"><o:p> </o:p> </div> <div class="separator" style="text-align: center; clear: both"><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikJ6CIoUr9y78VVoXZg6iCTR4uyY2O0AMVqfjebE1RqJQitlOEITiK_IbUPoKJMQOTZfJwkW1EXI0LpRJSrTbs8ToCEKpLkc4zQj6M5dBvZJQv6j1KTNrQYIqeggR-4G_R6KTBzhcxqPY/s1600/image002.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikJ6CIoUr9y78VVoXZg6iCTR4uyY2O0AMVqfjebE1RqJQitlOEITiK_IbUPoKJMQOTZfJwkW1EXI0LpRJSrTbs8ToCEKpLkc4zQj6M5dBvZJQv6j1KTNrQYIqeggR-4G_R6KTBzhcxqPY/s320/image002.png" width="320" height="261"></a></div> <div><br></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; mso-add-space: auto">Once you checked in, your folder will appear like below<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; mso-add-space: auto"> </div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; mso-add-space: auto"><a style="text-align: center; margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrWBuIuIBLpwyaerdd8D7BISlcOFvE4t9HlqrClTZotzjAhulKec9TuJQmI4iZ6Ni903dTQenea2H_dMBlVKcVKXUZDXC2siOQmrrLGnqWEuwsbCbQbG8ETpaZHplaY7KDpetjNxwd9II/s1600/image003.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrWBuIuIBLpwyaerdd8D7BISlcOFvE4t9HlqrClTZotzjAhulKec9TuJQmI4iZ6Ni903dTQenea2H_dMBlVKcVKXUZDXC2siOQmrrLGnqWEuwsbCbQbG8ETpaZHplaY7KDpetjNxwd9II/s1600/image003.png"></a></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; mso-add-space: auto"> </div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 108pt; text-indent: -108pt; mso-list: l4 level3 lfo1; mso-add-space: auto; mso-text-indent-alt: -9.0pt"><!--[if !supportLists]--><span style="font-size: 7pt"> </span>Note: You can also check out an existing solution to your work folder<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; mso-add-space: auto"> </div> <div class="MsoListParagraphCxSpLast" style="margin-left: 72pt; text-indent: -18pt; mso-list: l0 level1 lfo2; mso-add-space: auto"><span style="font-family: symbol">·</span><span style="font-size: 7pt"> </span>Create a project in the SQL management Studio and store the solution into above working directory (c:\testproject<o:p></o:p></div> <div><br></div> <div class="MsoNormal" style="text-indent: 36pt"> </div> <div class="separator" style="text-align: center; clear: both"><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg5vgPfZBdXzN0J-HpIUMr0gSWHcK_VkhwVoUrbc9LYnfsfM9Ql7Aa0u1QBQc1n8sGRE_Kq9nMiBkb8IRKX5qgoCeldBZTfD1mspT2kbDSceypW_1neL14pWEsQSUBcHVp9Tn0qCjM7dU/s1600/image004.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg5vgPfZBdXzN0J-HpIUMr0gSWHcK_VkhwVoUrbc9LYnfsfM9Ql7Aa0u1QBQc1n8sGRE_Kq9nMiBkb8IRKX5qgoCeldBZTfD1mspT2kbDSceypW_1neL14pWEsQSUBcHVp9Tn0qCjM7dU/s320/image004.png" width="320" height="240"></a></div> <div class="MsoListParagraphCxSpFirst" style="margin-left: 72pt; mso-add-space: auto"> </div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; mso-add-space: auto"> </div> <div class="MsoNormal"><b> Create External Tools<o:p></o:p></b><br><span style="font-size: 7pt"> </span>Open the external tools window</div> <div class="MsoListParagraphCxSpFirst" style="text-indent: -18pt; mso-list: l1 level1 lfo4"><o:p></o:p></div> <div class="MsoListParagraphCxSpFirst" style="text-indent: -18pt; mso-list: l1 level1 lfo4"> </div> <div class="MsoListParagraphCxSpFirst" style="text-indent: -18pt; mso-list: l1 level1 lfo4"> </div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="separator" style="text-align: center; clear: both"><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWR4iLCt1o3ZcGEdqjBnn_SwZmxv6otFUKfw6XCrqOd7EXfrfKF41S94R_FihSXJzwEcCQwEe1k9IjCK2k9PfYW_RsDu-HKBeoOIOV-mwMt8iUDIMttmGBbTqFgT8DIDIW-DjcRsuKTpw/s1600/image005.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWR4iLCt1o3ZcGEdqjBnn_SwZmxv6otFUKfw6XCrqOd7EXfrfKF41S94R_FihSXJzwEcCQwEe1k9IjCK2k9PfYW_RsDu-HKBeoOIOV-mwMt8iUDIMttmGBbTqFgT8DIDIW-DjcRsuKTpw/s320/image005.png" width="320" height="303"></a></div> <div class="separator" style="text-align: center; clear: both"><span style="text-align: left"><br></span></div><b> Create External Tools<o:p></o:p></b><br><span style="font-size: 7pt"> </span> Enter the title, command , Arguments and initial Directory as per the below list<br> <div class="separator" style="text-align: center; clear: both" dir="rtl"><span style="text-align: left"><br></span></div> <div class="MsoListParagraphCxSpMiddle" style="text-indent: -18pt; mso-list: l1 level1 lfo4"><o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle" style="text-indent: -18pt; mso-list: l1 level1 lfo4"> </div> <div class="separator" style="text-align: center; clear: both"><a style="text-align: center; margin-left: 1em; margin-right: 1em; text-indent: 0px" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL3DEqvfTycJXJiUtmYm2mLJXDvhlk8o7P9AjtSa2clTQo79CDQf240rhC5bYUwD35_pLEYrQPJ5hizBdJ7qPhcbM4L9c7XZFlAub96etAgOTxih-Q7taEiKehluBIykjmmBbRaptsIiw/s1600/image007.jpg" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL3DEqvfTycJXJiUtmYm2mLJXDvhlk8o7P9AjtSa2clTQo79CDQf240rhC5bYUwD35_pLEYrQPJ5hizBdJ7qPhcbM4L9c7XZFlAub96etAgOTxih-Q7taEiKehluBIykjmmBbRaptsIiw/s320/image007.jpg" width="320" height="309"></a></div> <div class="MsoListParagraphCxSpMiddle" style="text-indent: -18pt; mso-list: l1 level1 lfo4"></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"><b>List of commands and parameters<o:p></o:p></b></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"><b>Commit: <o:p></o:p></b></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle">Title : SVN CommitSollution<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Command : C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Arguments : /command:commit /path:"$(SolutionDir)"<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Intial Directory: $(SolutionDir)<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"><b>CommitFile:</b><o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle">Title : SVN Commitfile</div> <div class="MsoListParagraphCxSpMiddle"><o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Command : C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Arguments : /command:commit /path:"$(ItemFileName)$(ItemExt) "<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Intial Directory:<span style="font-size: 10pt; font-family: "Arial","sans-serif"; background: #131313; color: #cccccc; line-height: 115%"> $(ItemDir)</span><o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"><b>Revision History</b><o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle">Title : SVN-RevisionHistoryforItem<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Command : C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Arguments : /command:log /path:"$(SolutionDir)"<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle">Intial Directory: $(SolutionDir)<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"><b>How To use ?<o:p></o:p></b></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle">Choose the projects and select CommitSollution from your tools</div> <div class="MsoListParagraphCxSpMiddle"><o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="separator" style="text-align: center; clear: both"><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzERvAekmuFsuAByKD89gtFyPvkdEPXHqpTW0mYXaud8SamOE08HIMCDAIszisDkg9Yh14eEhKTmgy7kZvYt5Fa4hIjlrz8uX_QcvrcLUlEXCGzrhg2LZmRXIrWGk2REXxWdPmOdcJ-BI/s1600/image009.jpg" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzERvAekmuFsuAByKD89gtFyPvkdEPXHqpTW0mYXaud8SamOE08HIMCDAIszisDkg9Yh14eEhKTmgy7kZvYt5Fa4hIjlrz8uX_QcvrcLUlEXCGzrhg2LZmRXIrWGk2REXxWdPmOdcJ-BI/s320/image009.jpg" width="320" height="87"></a></div><br><br> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle">It will list out all the solution files. Please choose the new Project(s) which you would like to add.<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle">Note: You can use the All button to select all the files automatically<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="separator" style="text-align: center; clear: both"><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicbPos5rx4BAhVyE-g9ooo201QfaAtdUNE2-kFsyhWl-r6ObasKB2Y0CQIiaEHxp1oJhSBlRzCmmMe4Wquw6Szb8aHvt00cjIoJnlb-PHXuIwiVp0EuuTs6RHXa6aVBmvvs8VCbVhAPuE/s1600/image010.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicbPos5rx4BAhVyE-g9ooo201QfaAtdUNE2-kFsyhWl-r6ObasKB2Y0CQIiaEHxp1oJhSBlRzCmmMe4Wquw6Szb8aHvt00cjIoJnlb-PHXuIwiVp0EuuTs6RHXa6aVBmvvs8VCbVhAPuE/s320/image010.png" width="258" height="320"></a></div> <div><br></div> <div class="MsoListParagraphCxSpLast" style="text-indent: -18pt; mso-list: l3 level1 lfo5"><b><br></b><br> <h3 style="text-align: left"><b>Commit changes of your files</b></h3>If you prefer to commit the changes in a single file then “CommitFile” option can be used</div> <div class="MsoNormal" style="margin-left: 36pt"><o:p></o:p></div> <div class="MsoListParagraphCxSpFirst" style="margin-left: 72pt; text-indent: -18pt; mso-list: l3 level2 lfo5; mso-add-space: auto"><!--[if !supportLists]-->a.<span style="font-size: 7pt"> </span><!--[endif]-->Select the file which has had some change from the last check in<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; text-indent: -18pt; mso-list: l3 level2 lfo5; mso-add-space: auto"><!--[if !supportLists]-->b.<span style="font-size: 7pt"> </span><!--[endif]-->Only the file which has had any change will appear<o:p></o:p></div> <div class="MsoListParagraphCxSpMiddle" style="margin-left: 72pt; mso-add-space: auto"> </div> <div class="separator" style="text-align: center; clear: both"><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi0q218iHq81rzSm91s4dhBxC3a62-6trvgdyeudL1rZ-dxpALtkXHDR6grrBbnH-Lx7ih4T1dxKID2AFvvUJ58MkEk8E9zuT-Ptb2FuJQRGrM-VGzVzjxV6gOURnYWNeqh5mo1Dy8itA/s1600/image012.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi0q218iHq81rzSm91s4dhBxC3a62-6trvgdyeudL1rZ-dxpALtkXHDR6grrBbnH-Lx7ih4T1dxKID2AFvvUJ58MkEk8E9zuT-Ptb2FuJQRGrM-VGzVzjxV6gOURnYWNeqh5mo1Dy8itA/s320/image012.png" width="257" height="320"></a></div><span style="font-size: 11pt; font-family: "Calibri","sans-serif"; line-height: 115%; mso-fareast-font-family: calibri; mso-bidi-font-family: "Times New Roman"; mso-ansi-language: en-gb; mso-ascii-theme-font: minor-latin; mso-bidi-language: ar-sa; mso-bidi-theme-font: minor-bidi; mso-fareast-language: en-us; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin"><br style="page-break-before: always; mso-special-character: line-break" clear="all"></span><br> <div class="MsoNormal"> </div> <div class="MsoListParagraph" style="text-indent: -18pt; mso-list: l3 level1 lfo5"> <h3 style="text-align: left"><b>Check the revision History</b></h3><o:p></o:p></div> <div class="MsoNormal" style="margin-left: 36pt; tab-stops: 84.0pt">Another common requirement and advantage of using source control would be comparing it against one of the older versions.</div> <div class="MsoNormal" style="margin-left: 36pt; tab-stops: 84.0pt"><o:p></o:p></div> <div class="MsoNormal" style="margin-left: 36pt; tab-stops: 84.0pt"> </div> <div class="MsoNormal" style="margin-left: 36pt; tab-stops: 84.0pt">In my example I have two versions: <o:p></o:p></div> <div class="MsoNormal" style="margin-left: 36pt; tab-stops: 84.0pt">First one I checked in during the initial upload and the upload in the previous step. <o:p></o:p></div> <div class="MsoNormal" style="margin-left: 36pt; tab-stops: 84.0pt">In the second version I have added the below query<o:p></o:p></div> <div class="MsoNormal" style="margin-bottom: 0pt; text-indent: 36pt">“<span style="font-family: "Courier New"; color: blue">select</span><span style="font-family: "Courier New""> <span style="color: grey">*</span> <span style="color: blue">from</span> <span style="color: teal">[dbo]</span><span style="color: grey">.</span><span style="color: teal">[DimEmployee]” </span></span>into the sampleQuery <o:p></o:p></div> <div class="MsoNormal" style="margin-bottom: 0pt; text-indent: 36pt"> </div> <div class="MsoNormal" style="margin: 0cm 0cm 0pt 36pt">If I select the samplequery.sql and select SVN-Revisiohistoryforitem then it will appear as below<o:p></o:p></div> <div class="MsoNormal" style="margin-bottom: 0pt; text-indent: 36pt"> </div> <div class="separator" style="text-align: center; clear: both"><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMo_E_2iUaJ3Gr9NKY5-b26hJ6PHZHx7lq9MbB8bvJpthmtj98cw-YaMK3kTmipzQ-BPxZj6-_TcF-Sx6xW569OVFM2KRPTPSzGsganHyOxvt9pqkdnHAxZ9WLOB21f0jDI5ygS25TDeM/s1600/image015.jpg" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMo_E_2iUaJ3Gr9NKY5-b26hJ6PHZHx7lq9MbB8bvJpthmtj98cw-YaMK3kTmipzQ-BPxZj6-_TcF-Sx6xW569OVFM2KRPTPSzGsganHyOxvt9pqkdnHAxZ9WLOB21f0jDI5ygS25TDeM/s400/image015.jpg" width="400" height="130"></a></div> <div><br></div> <div class="MsoNormal" style="margin-bottom: 0pt; text-indent: 36pt"> </div> <div class="separator" style="text-align: center; clear: both"><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo_m6W_8jIX0OG3IJAEDeTeK8Fk-MmkrW7-2cF2XcJ4oKz68yB9CnlNtiFpz05GN67T7l7aIjsmkMvXOWve3AIvA6FWLNIuE7V4tuPAcmFlmUMknfNec29brtwI78U1OBKJZfwGEjdlAA/s1600/image016.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo_m6W_8jIX0OG3IJAEDeTeK8Fk-MmkrW7-2cF2XcJ4oKz68yB9CnlNtiFpz05GN67T7l7aIjsmkMvXOWve3AIvA6FWLNIuE7V4tuPAcmFlmUMknfNec29brtwI78U1OBKJZfwGEjdlAA/s400/image016.png" width="400" height="332"></a></div> <div class="MsoNormal" style="margin-bottom: 0pt; text-indent: 36pt"> </div> <div class="MsoNormal" style="margin-left: 36pt; tab-stops: 84.0pt">You can select the version of your choice and compare it with working copy.<o:p></o:p></div> <div class="MsoNormal" style="margin-left: 36pt; tab-stops: 84.0pt"> </div> <div class="MsoListParagraphCxSpFirst"><b></b></div> <div><br></div> <div class="separator" style="text-align: center; clear: both"><b><a style="margin-left: 1em; margin-right: 1em" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQpFvamwXUhpypoiKUD8JmMzqyVI9tb-UcNWGfD9HqPe9-UvgRdM6KNr8ev8kySEAq8PfI1emM8w5GAaA3FP-RscpDsJLoE9lebXpierRPygVcTV_oRkjzo12sRb_ehi7pF9g6RjvYrc/s1600/image019.jpg" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQpFvamwXUhpypoiKUD8JmMzqyVI9tb-UcNWGfD9HqPe9-UvgRdM6KNr8ev8kySEAq8PfI1emM8w5GAaA3FP-RscpDsJLoE9lebXpierRPygVcTV_oRkjzo12sRb_ehi7pF9g6RjvYrc/s640/image019.jpg" width="640" height="100"></a></b></div> <div class="separator" style="text-align: center; clear: both"><b><br></b></div> <div class="separator" style="text-align: center; clear: both"><b><br></b></div><b><o:p></o:p></b><br> <div class="MsoListParagraphCxSpMiddle"><b>Just works like a charm </b><b><span style="font-family: wingdings; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ascii-font-family: calibri; mso-char-type: symbol; mso-hansi-font-family: calibri; mso-symbol-font-family: wingdings">J</span><o:p></o:p></b></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div class="MsoListParagraphCxSpMiddle"><b><br></b></div> <div class="MsoListParagraphCxSpMiddle"><b>Thanks to </b><span style="font-size: 12px; font-family: 'Lucida Grande', arial, helvetica, sans-serif; color: #aaaaaa; line-height: 16px; background-color: #131313">John Rummell</span><b> on external tools and SSMS</b></div> <div class="MsoListParagraphCxSpMiddle"> </div> <div><br></div> <div class="MsoListParagraphCxSpLast">Credits to : <a href="http://www.jrummell.com/blog/index.php/2009/11/sql-server-management-studio-and-tortoisesvn/">http://www.jrummell.com/blog/index.php/2009/11/sql-server-management-studio-and-tortoisesvn/</a><o:p></o:p></div></div> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com5tag:blogger.com,1999:blog-3190166579815746224.post-9630039926871428112013-05-12T03:01:00.000-07:002013-10-01T05:02:54.823-07:00Use SSMS 2012 with SQL server 2008<div style="text-align: center; clear: both" dir="ltr" class="separator" trbidi="on"></div> <div style="text-align: left; margin-left: 1em; margin-right: 1em" dir="ltr" trbidi="on"><br></div> <div style="text-align: left" dir="ltr" trbidi="on"><br><br>SQL server Management studio 2012 is freely downloadable from Microsoft site and it is compatible with Sql server 2008.I was using this for past 3 months and found it very useful, so I listed down some useful new features and changes<br><br>Even if your company is not ready to upgrade to 2012, this free client upgrade is worth the try<br><br>Some useful features<br><br></div> <div style="text-align: left" dir="ltr" trbidi="on"> <ol style="text-align: left"> <li>Usability : SSMS 2012 is powered by visual studio so the UI looks lot similar with Visual studio <li>I always have issues with 2008 intellisense (autofill) which is very slow and sometimes even manual refresh take longer time to refresh the metadata. But 2012 is very impressive and i am much surprised about the meta data management. <li>In 2012 intellisense accept part name search. E.g . If your table name is abc_xyz_ETL then you can type xyz which will pick all the tables which contains the xyz while writing the query <li>The new improved MDX query editor with MDX intelisense is very useful for SSAS query editing. <li>New Source safe integration - the SSMS 2012 can be easily integrated with team foundation server with a free plugin. I am really hoping to see some free plugin for subversion soon. <li>Projects are easy to create and maintain <li>You can create custom template which can be created and used across organisation <li>New SQL CMD Mode. So you can mix DOS and sql command in the script. Very useful to move and import from excel/csv files via DB links <li>Very easy to pass the list of servers to the new joiner as you can export the registered servers to other machine</li></ol></div> <p> </p> <div>For more information please refer to </div> <div><br></div> <div><a href="http://msdn.microsoft.com/en-us/library/ms174219.aspx">http://msdn.microsoft.com/en-us/library/ms174219.aspx</a><br><br><br></div> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-83355647834979498682013-04-20T14:35:00.000-07:002013-10-09T08:45:41.105-07:00Convert rows into comma separated column using single query with XML<div style="text-align: left" dir="ltr" trbidi="on"> <div style="margin: 0in"><span style="font-family: calibri"><span style="font-size: 15px"><b>Convert rows into comma separated column using single query with XML</b></span></span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-weight: bold"><br></span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt">Have you ever try to covert list of rows into an comma separated column? There are many solution available based on the coalesce but I found an interesting fact about the XML Path by which we can easily achieve the same functionality without much of hassle.</div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-weight: bold"><br></span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-size: 11pt">In the below example I have created a query to extract table and column names from the information_schema for two test tables</span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-weight: bold"><br></span></div> <div style="margin: 0in"><span style="font-family: 'Courier New'; color: blue; font-size: x-small">SELECT</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">table_name</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">,</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">column_name</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; color: blue; font-size: x-small">FROM</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">information_schema</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">.</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">columns</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; color: blue; font-size: x-small">WHERE</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">table_name</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: blue; font-size: x-small">IN</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">(</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: red; font-size: x-small">'DimProductCategory'</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">,</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: red; font-size: x-small">'DimCurrency'</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">)</span><span style="font-family: 'Courier New'; font-size: x-small"> </span></div> <div> </div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-weight: bold">output</span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-weight: bold"><br></span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPdyMsxBxOTpUH1MVTB8nw3NAqp-W_Vu8rZPH143IrA4HyZRoObL5N4xH7_MdP662FEHAM_VJGeY7GdPl8sI1Vf-8f7nXWlaaQ4_pHpfk5mXkivUcWHQxaBpzLuhVpfWV6gTrx343HcaU/s1600-h/image%25255B2%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEishzx9OCJqOWo2H_XyYvAF2VXkRFkxBJ6_UZ8h_79_MY7eThJKsrTRXxHt2ckPNKxbrsSn_yEsYnFNT3UdZSIwubqzxRmBQOjSzwmPalYKvqV1fZHjPtUfXNrnQcP7JLnNFLWxL0JX_bU/?imgmax=800" width="244" height="141"></a><br><br>Now if we just want to display two rows for each table and concatenate the columns into single value with a delimiter then we can simply achieve this by below query.</div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-weight: bold"><br></span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-family: 'Courier New'; color: blue; font-size: x-small">SELECT</span><span style="font-family: 'Courier New'; font-size: x-small"> Distinct </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">col2</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">.</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">table_name</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">,</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: magenta; font-size: x-small"><i>Stuff</i></span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">(</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">(</span><span style="font-family: 'Courier New'; color: blue; font-size: x-small">SELECT</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: red; font-size: x-small">','</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">+</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">column_name</span><br><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: green; font-size: x-small"><i>-- Stuff used here only to strip the first character which is comma (,).</i></span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: blue; font-size: x-small">FROM</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">information_schema</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">.</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">columns</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">col1</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: blue; font-size: x-small">WHERE</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">col1</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">.</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">table_name</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">=</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">col2</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">.</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">table_name</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: blue; font-size: x-small">FOR</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">xml</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">path</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">(</span><span style="font-family: 'Courier New'; color: red; font-size: x-small">''</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">)</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">)</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">,</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; font-size: x-small">1</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">,</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; font-size: x-small">1</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">,</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: red; font-size: x-small">''</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">)</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; color: blue; font-size: x-small">FROM</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">information_schema</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">.</span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">columns</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">col2</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><br><span style="font-family: 'Courier New'; color: blue; font-size: x-small">WHERE</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">table_name</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: blue; font-size: x-small">IN</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">(</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: red; font-size: x-small">'DimProductCategory'</span><span style="font-family: 'Courier New'; color: silver; font-size: x-small">,</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: red; font-size: x-small">'DimCurrency'</span><span style="font-family: 'Courier New'; font-size: x-small"> </span><span style="font-family: 'Courier New'; color: maroon; font-size: x-small">)</span><span style="font-family: 'Courier New'; font-size: x-small"> </span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-family: 'Courier New'; font-size: x-small"><br></span><span style="font-family: 'Courier New'; font-size: x-small"><br></span><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXlxf8PPsDXa-rgIfELNrcD3Kj6O5pbtpv_Nmr4kXbFVfUzJLhyUxQUj2hISHoewiuvf272eoNckULJ30sig-gK1kilb2qkSKm9gdFXokhmnRmLJYYx7_e8brM1PlBUrTVzIYaz0k_mco/s1600-h/image%25255B5%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx5GOXYavm7TQo-y32vc6CouwelYkFQJ3-v4qOAM2XH-FNvKBOJUKEgX9c3GJRYwXTV-SYTrc7INZamr3kdq-2kO-J0gL0e4Wv6Sanv_FXauUF-zSECcPaZ3TK3s2pvtGBacDDR7V48JA/?imgmax=800" width="244" height="53"></a><span style="font-family: 'Courier New'; font-size: x-small"><br></span><span style="font-family: 'Courier New'; font-size: x-small"><br></span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt"><span style="font-weight: bold">Further Learning</span></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt">Stuff : <a href="http://msdn.microsoft.com/en-us/library/ms188043.aspx">http://msdn.microsoft.com/en-us/library/ms188043.aspx</a> </div> <div><br></div> <div style="margin: 0in; font-family: calibri; font-size: 11pt">FOR XML PATH : <a href="http://blog.sqlauthority.com/2009/02/12/sql-server-simple-example-of-creating-xml-file-using-t-sql/">http://blog.sqlauthority.com/2009/02/12/sql-server-simple-example-of-creating-xml-file-using-t-sql/</a></div></div> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-85733578722150372152013-03-10T04:07:00.000-07:002013-10-09T08:37:28.820-07:00SSRS lookup and lookup set – Similar to Excel<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
On the other day I came across a interesting functionality in the SSRS. They are Lookup and Lookup set functions , these functions are very useful for multi source reports<br />
<strong>Simple Abstract :</strong><br />
Lookup : Just like the Excel Vlookup function which can get the data from another dataset<br />
Lookupset: Same like lookup but returns all the matching results and will be very useful for displaying all the matching results, This can be converted to comma separated form using Join function.<br />
Check the Below Blog for details <br />
<a href="http://www.bidn.com/blogs/DustinRyan/bidn-blog/2037/lookup-and-lookupset-functions-new-in-ssrs-2008-r2">http://www.bidn.com/blogs/DustinRyan/bidn-blog/2037/lookup-and-lookupset-functions-new-in-ssrs-2008-r2</a> <br />
<br />
<br />
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c51094e2-ccd2-4d37-b946-a6256b4dc418" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Technorati Tags: <a href="http://technorati.com/tags/Excel+vLookup+in+SSRS" rel="tag">Excel vLookup in SSRS</a></div>
<br />
</div>
Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-21948677008488590692013-02-10T03:40:00.000-08:002013-10-09T08:40:01.950-07:00Import Active Directory (AD) Groups and user names via SSIS into SQL server table<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: black; font-family: Arial; font-size: x-small;">Before getting into the technical details, I will explain the need for this. </span><br />
<ol>
<li><span style="color: black; font-family: Arial; font-size: x-small;">If you manage SQL server Security via AD Groups due to high volume of business users then you would have already hit the problem and looking for solution to import the mapping details of groups vs users</span> </li>
<li><span style="color: black; font-family: Arial; font-size: x-small;">If you are using SSRS suit for the reporting needs and if you have large user base then AD group based security is the best way to segregate user access. But once again to answer who has what rights you need this mapping information.</span></li>
</ol>
<h3>
<strong>Step 1:</strong> Create the table structure necessary to import the SSIS Groups and Names in two tables</h3>
<span style="color: black; font-family: Arial; font-size: x-small;">Table 1: ActiveDirectoryUserGroups – This tables gives you the relationship between users and their group name they belongs to</span><br />
<div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;">
<div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span style="color: blue;">CREATE</span> <span style="color: blue;">TABLE</span> [dbo].[ActiveDirectoryUserGroups](</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">[id] [<span style="color: blue;">int</span>] <span style="color: blue;">IDENTITY</span>(1,1) <span style="color: blue;">NOT</span> <span style="color: blue;">NULL</span>,</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">[GroupName] [<span style="color: blue;">varchar</span>](1000) <span style="color: blue;">NULL</span>,</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">[username] [<span style="color: blue;">varchar</span>](1000) <span style="color: blue;">NULL</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">) </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span style="color: blue;">GO</span></pre>
<!--CRLF--></div>
</div>
<br />
<style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br />
<br />
<span style="font-family: Arial; font-size: x-small;">Table 2:ActiveDirectoryGroupRelation – This table gives you the relationship between Groups</span><br />
<br />
<div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;">
<br />
<div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span style="color: blue;">CREATE</span> <span style="color: blue;">TABLE</span> [dbo].[ActiveDirectoryGroupRelation](</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">[id] [<span style="color: blue;">int</span>] <span style="color: blue;">IDENTITY</span>(1,1) <span style="color: blue;">NOT</span> <span style="color: blue;">NULL</span>,</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">[GroupName] [<span style="color: blue;">varchar</span>](1000) <span style="color: blue;">NULL</span>,</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">[ParentGroupName] [<span style="color: blue;">varchar</span>](1000) <span style="color: blue;">NULL</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">) </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span style="color: blue;">GO</span></pre>
<!--CRLF--></div>
</div>
<br />
<h3>
<span style="font-family: Arial; font-size: x-small;"></span> </h3>
<br />
<h3>
Step2: Create the necessary connection to your database where the above table exist</h3>
<pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHCBCoopGHqANqpPtHgreRNHgbhrQfTmH5XsN_wtnAPNFktMF-YqFabAjODdSoyn5w1PZxw2D5O5o6TxhhidBGAkeHzxqNX26KukgQAGmULII8TucOLvuIq1Sz7K3ROYJh4W1lfnls_8Q/s1600-h/image3.png"><span style="font-family: Arial;"><img alt="image" border="0" height="305" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbP94KyrleBCn_GLAHUZKeKFiIUYFpY8UY2QMjQeHaN5L9_SVMbC3MM9e7nRYOS8jnBT8EaIobImdMBb17lZaeK3NDQyrca6GfHIPbnWrYIh3KYEGdvU_-hjwpcMeqwNkDn_oP0RLk5QY/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="297" /></span></a><span style="font-family: Arial;"> </span></pre>
<br />
<h3>
Step 3: Create SQL task to clear the data before load. </h3>
<pre class="csharpcode"><span style="font-family: Arial;">(Alternatively, you can import the changes alone via lookup or in other words use the incremental load approach . But that is not the point of this blog so to keep this simple I will just truncate the records before load)</span></pre>
<pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6h6f5ugBbAIGOAgOgMV9UbqbogYQn7mtAKDvC5DDMp0bi_8ZpyuwI38SyW-NqpzztCB-Edl-mnVRXFFzFaNr9kvqPS-eYunSMWWtZGnXRGSeMrT4uTMzPPfd_UoNqKlsMIQqX8YFmM-c/s1600-h/image7.png"><span style="font-family: Arial;"><img alt="image" border="0" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZvdrlvh1jWKvvR-bxMb-7Gpf0LI8tC_2GTlUMCVyVMniQVUQFWogfMonVPmQN-eopCyeybobolkPoO_pQ66H20eCXXXvgutxljYrDyNrt_pot68PICaQUevVPlbKHx-D3Ap5dJdbBwTY/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="370" /></span></a><span style="font-family: Arial;"> </span></pre>
<br />
<h3>
Step 4: Create a data flow task in the control flow to fetch mapping between groups</h3>
<pre class="csharpcode"><span style="font-family: Arial;">(Name it suitably E.g “DFL_ActiveDirectory_Group_relation_load”)</span></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Create Three Variables in the data flow task scope</span></pre>
<pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzcwtn5Udz6km8VwEv-9wmmZJ1PunxxRrIiXMTQGq6eGG9ZbaoQJJ03hoa1deNu1ZQDy6GdXTj3ptDt9JtjZorvg02rWZvkDveeRvcyD8HTNIyKKaAtv5637klNQHH6U-wFwzROysyIHI/s1600-h/2jpmvrye%25255B3%25255D.jpg"><img alt="2jpmvrye" border="0" height="123" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfFVrfDI20xajnLGnWMhCbQ64PonYvKQGzdn4dYW2I2NjRQsLwMHes0FXQ5_t8ioXbG_OSDG04M6qAv9dvX9yh0iSoNYelJlLxi0AC_sFlQ6Dolm8sqxNiz6iRdaj6Pa9jF9dlK2v1JSs/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2jpmvrye" width="394" /></a></pre>
<br />
<span style="font-family: Arial;"><span style="color: blue;"><strong>Note:</strong> Replace Domain with your mail Domain. E.g. “Pinnacle-Int” and “Extension” with your Domain extension E.g. “Com”</span></span><br />
<br />
<h4>
Create a “Source Script Component”. as shown below.</h4>
<pre class="csharpcode"><span style="font-family: Arial;">Make sure to declare all three variables as read only variables as shown below</span></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Choose your choice of scripting language</span></pre>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7Sy12av_YgYp4nIZBss3a8g7vaPj3O056-GEOkHXPQJJ3o1ynJg7T3i1ntvsLYrR303h_P3rJKDy5q9VzLp4u7MQ_xAHvA-wJ5MHQjCXqjZjshbZIdDWVWVC7zPYJ5Eppjlb3KAxl9Q8/s1600-h/image15.png"><span style="font-family: Arial; font-size: x-small;"><img alt="image" border="0" height="375" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigGmKd_FCGeZCTqwT-SJm7rrbr8FaPINTR0uxDcFKhQz6VGCrAcwKEpvzRIOCbh6HRg-gCgpisD6mCzw9omp88E0tPmhj7vHNzGz5dPl0u1CyDzcxctHcUzGqQNgjyLmDwhJt_jwkvAIE/?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="429" /></span></a><span style="font-family: Arial; font-size: x-small;"> </span> <br />
<pre class="csharpcode"><span style="font-family: Arial;">Set the outputs correctly</span></pre>
<pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-g3Qe6lyAnWsgxSdcc_r4i66t-Tb2qzbVE285L7TfIk8vv0GC4_wIzbEkVQFZVo1LFKpzYe0CotO65tLmXQ6LIyuFCfJCsXN-W3CDULoYgNlrf3fapHtnn-1VaOKk3GpcRRtI1R-V1gM/s1600-h/image%25255B4%25255D.png"><span style="font-family: Arial;"><img alt="image" border="0" height="406" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK4NAtA67Yyx8jFILUJymrIiKWYjWfaS6polZviLplAUYRMifPXFQN8NZlRddmzLky765SjTLNQdMz4D6AGzajsdyihmdDr0Lgb5z0wEnbLhu-QZvGddbbEwPnNdjZySQNgLsKETSDcCw/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="459" /></span></a></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Paste the below code in the Scripter</span></pre>
<br />
<br />
<div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;">
<br />
<div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span style="color: blue;">Public</span> <span style="color: blue;">Overrides</span> <span style="color: blue;">Sub</span> CreateNewOutputRows()</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> de <span style="color: blue;">As</span> <span style="color: blue;">New</span> DirectoryEntry</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> searcher <span style="color: blue;">As</span> <span style="color: blue;">New</span> DirectorySearcher</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> search_result <span style="color: blue;">As</span> SearchResultCollection</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> result <span style="color: blue;">As</span> SearchResult</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> props <span style="color: blue;">As</span> ResultPropertyCollection</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> MemberOfList <span style="color: blue;">As</span> StringBuilder</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> values <span style="color: blue;">As</span> ResultPropertyValueCollection</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> name <span style="color: blue;">As</span> <span style="color: blue;">String</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> groups <span style="color: blue;">As</span> ArrayList</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Using (de)</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> de.Path = <span style="color: blue;">Me</span>.ReadOnlyVariables(<span style="color: #006080;">"Path"</span>).Value.ToString</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Using (searcher)</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> searcher.SearchRoot = de</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> searcher.Filter = <span style="color: blue;">Me</span>.ReadOnlyVariables(<span style="color: #006080;">"Filter"</span>).Value.ToString</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> searcher.SearchScope = SearchScope.Subtree</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: green;">' Retrive ActiveDirectory column list</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> searcher.PropertiesToLoad.Add(<span style="color: #006080;">"samaccountname"</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> searcher.PropertiesToLoad.Add(<span style="color: #006080;">"memberof"</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: green;">'sort the result</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> searcher.Sort = <span style="color: blue;">New</span> SortOption(<span style="color: #006080;">"samaccountname"</span>, SortDirection.Ascending)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: green;">' you can set your own limits</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> searcher.PageSize = <span style="color: blue;">Me</span>.ReadOnlyVariables(<span style="color: #006080;">"MaxRecord"</span>).Value</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: green;">'Retrieve the results from Active Directory</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> search_result = searcher.FindAll()</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> MemberOfList = <span style="color: blue;">New</span> StringBuilder <span style="color: green;">'Members/Groups list.</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> entry <span style="color: blue;">As</span> DictionaryEntry</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">For</span> <span style="color: blue;">Each</span> result <span style="color: blue;">In</span> search_result</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> props = result.Properties</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">For</span> <span style="color: blue;">Each</span> entry <span style="color: blue;">In</span> props</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> values = entry.Value</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">If</span> entry.Key.ToString = <span style="color: #006080;">"samaccountname"</span> <span style="color: blue;">Then</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> name = GetSingleValue(values)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">End</span> <span style="color: blue;">If</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">If</span> entry.Key.ToString = <span style="color: #006080;">"memberof"</span> <span style="color: blue;">Then</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> groups = GetGroups(values)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">For</span> <span style="color: blue;">Each</span> group <span style="color: blue;">In</span> groups</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> ListofusersoutputBuffer.AddRow()</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> ListofusersoutputBuffer.Name = name</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> ListofusersoutputBuffer.MemberOf = group</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Next</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">End</span> <span style="color: blue;">If</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Next</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Next</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">End</span> Using</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">End</span> Using</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">End</span> <span style="color: blue;">Sub</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Private</span> <span style="color: blue;">Function</span> GetSingleValue(<span style="color: blue;">ByVal</span> values <span style="color: blue;">As</span> ResultPropertyValueCollection) <span style="color: blue;">As</span> <span style="color: blue;">String</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">For</span> <span style="color: blue;">Each</span> val <span style="color: blue;">As</span> <span style="color: blue;">Object</span> <span style="color: blue;">In</span> values</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Return</span> val.ToString()</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Next</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Return</span> <span style="color: blue;">Nothing</span></pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">End</span> <span style="color: blue;">Function</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Private</span> <span style="color: blue;">Function</span> GetGroups(<span style="color: blue;">ByVal</span> values <span style="color: blue;">As</span> ResultPropertyValueCollection) <span style="color: blue;">As</span> ArrayList</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> valueList <span style="color: blue;">As</span> <span style="color: blue;">New</span> ArrayList()</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">For</span> <span style="color: blue;">Each</span> val <span style="color: blue;">As</span> <span style="color: blue;">Object</span> <span style="color: blue;">In</span> values</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> memberof <span style="color: blue;">As</span> <span style="color: blue;">String</span> = val.ToString()</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> pairs() <span style="color: blue;">As</span> <span style="color: blue;">String</span> = memberof.Split(<span style="color: #006080;">","</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Dim</span> group() <span style="color: blue;">As</span> <span style="color: blue;">String</span> = pairs(0).Split(<span style="color: #006080;">"="</span>)</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> valueList.Add(group(1))</pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Next</span></pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<!--CRLF--><br />
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">Return</span> valueList</pre>
<!--CRLF--><br />
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> <span style="color: blue;">End</span> Function</pre>
<!--CRLF--></div>
</div>
<br />
<br />
<style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br />
<pre class="csharpcode"><span style="font-family: Arial;">Connect the Appropriate Destination as shown below</span></pre>
<pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSw_6arnfd2FfJavGvV1uYiPiYsTsWLg0bd2VmT4Re8Ge0vJkpSPE9fSk1jfH0VuNqXYAxX9mTN-x2p_7Vyo3jHuP_cxbLjg47ppjNVlQCaWg7exIluEeWNKctW0HTrdcG7R1qCBGQ0jQ/s1600-h/image%25255B7%25255D.png"><span style="font-family: Arial;"><img alt="image" border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb_5DUYWwI7Yf-6-RbxM2RWvhrrU9XTS2sbyOD93csltULP2B6ZG6aO_Urj8wMSX79ze5VUgI_bKtXoum5mLMw7sNVopxGT6p_TK4Puj4VjvuUA5Gsv9l2YWdsUGd6EeQZrUM4fcnw6OI/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /></span></a></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Do the Appropriate mappings for ActiveDirectoryGroupRelation</span></pre>
<pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWodU9y_faMH434c_50wHpeuWZr7RZIhuc_XY3zjdmGgyKdLqoGWbtxvEdUzkInQMf4JSh3aNfTTwgizLjYibFfoez58964_IhRA9ZsQyNA-OQCa1-Ck8V0z4FyRe9HiBEkHg9L-VMrUk/s1600-h/image%25255B17%25255D.png"><span style="font-family: Arial;"><img alt="image" border="0" height="287" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYMWEIRaxEc8_FChR26G5394fI-GkrulCkkhRklu6GdkTVZD3i_TDOHrp5XfatbdaVHw0aNfYkQZHRsJawFYJWZAtNI9TR_uakO-Cif0rq4ROv7JJd5jzV7MMFlNO64RmBmNJJP2PixW4/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="320" /></span></a></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Test whether the load is successful</span></pre>
<br />
<style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br />
<br />
<h3>
Step 5: Create a data flow task in the control flow to fetch mapping between user and groups</h3>
<pre class="csharpcode"><span style="font-family: Arial;">(name it suitably E.g “DFL_ActiveDirectory_user_group_relation_load”)</span></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Follow the same similar steps as above. Only difference is load them with below Variables.</span></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Create Three Variables in the data flow task scope</span></pre>
<pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2_JUZO9kruCRCJEJYS2ej91EYvfFnQyvasl-HSyzySQTbQpCOgDx1nf9bmuPuyLjj0to62iSZN37HspPQEyYS8DXLZ2PPxVwNa0pCBwDz2GMhFjosEAN7UnUAL6mqTCLSOwxHLtRgdF4/s1600-h/m4fmfsat%25255B3%25255D.jpg"><img alt="m4fmfsat" border="0" height="128" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxDaRNt-NSGPpMt8fJW1pSCpp0Mz1ivAuOup7uxrH95ePTPgCr8VStMBKr47YVtXNEqPXv-OclbqChqAONiEviH3GIZlXFw1haQOPZtKXsR8PwL81DuHIBYuhkMtXdWu8eDopg7Lf4U0o/?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="m4fmfsat" width="386" /></a></pre>
<pre class="csharpcode"><span style="font-family: Arial;"><strong>Note:</strong> Replace Domain with your mail Domain name. E.g. “Pinnacle-Int” and “Extension” with your Domain extension E.g. “Com”</span></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Also make sure to load “ActiveDirectoryUserGroups” table this time</span></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Your Final solution should look like below</span></pre>
<pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHVUeSoyWUH34W8nLbKRmFi81jYZ5B9izoZ8ot7LoqQhYmp1gHVXAFCNbUZbvOmIlKQh_t-zVqM6oGXImCqFu6dAIGCXtvQdUw0dW9Zpyb2VOYlwPcOKTeZqy_JNi7ew7ADTJNxum246Y/s1600-h/image%25255B23%25255D.png"><span style="font-family: Arial;"><img alt="image" border="0" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjsStNgGwsQ15Zcv_RgDemauzSjTb8RxQFvYDAm0mM1KgUZMvI5RfWMrhgpKMB3ffBEJuVu4UeKHDsNvKLproIblxUMve-E7L5w0ihhx7E75R6uQktmAro1j2zQ-wocVvdR3nY8e9D-Wo/?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="117" /></span></a></pre>
<pre class="csharpcode"><span style="font-family: Arial;">Hope that is helpful!</span></pre>
</div>
Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-40268538873866725032013-01-20T11:38:00.000-08:002013-10-09T08:40:41.453-07:00Naming Conventions for Report objects, Data Sources, and Datasets<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Use naming conventions for data sources and datasets that document the source of data.<br />
<ol>
<li><b>Data sources</b>. If you do not want to use an actual server or database due to security reasons, use an alias that indicates to the user what the source of data is. <ol>
<li>Start with DS and followed by databasename(Avoid server name as this will change during the deployment) (e.g. DS_AdventureWorks) </li>
</ol>
</li>
<li><b>Datasets.</b> Use a name that indicates which data source it is based on. <ol>
<li>Start with DT and followed by datasorurce name and followed by meaningful name about the dataset (e.g. DT_DS_AdventureWorks_Customerinfo) </li>
</ol>
</li>
</ol>
All the Report items should be named with three letter abbreviation(as shown below) followed by a meaningful name <br />
E.g. the name of a Tablix which shows the policy summary will be “TBXPolicySummary” <table border="0" cellpadding="0" cellspacing="0"> <tbody>
<tr> <td valign="bottom" width="99"><b>Report Item </b></td> <td valign="bottom" width="180"><b>Three letter Abbreviation</b></td></tr>
<tr> <td valign="bottom" width="99">Text Box</td> <td valign="bottom" width="180">TXT</td></tr>
<tr> <td valign="bottom" width="99">Line</td> <td valign="bottom" width="180">LNE</td></tr>
<tr> <td valign="bottom" width="99">Table</td> <td valign="bottom" width="180">TBL</td></tr>
<tr> <td valign="bottom" width="99">Matrix</td> <td valign="bottom" width="180">MTX</td></tr>
<tr> <td valign="bottom" width="99">Rectangle</td> <td valign="bottom" width="180">REC</td></tr>
<tr> <td valign="bottom" width="99">List</td> <td valign="bottom" width="180">LST</td></tr>
<tr> <td valign="bottom" width="99">Image</td> <td valign="bottom" width="180">IMG</td></tr>
<tr> <td valign="bottom" width="99">SubReport</td> <td valign="bottom" width="180">SRE</td></tr>
<tr> <td valign="bottom" width="99">Chart</td> <td valign="bottom" width="180">CHT</td></tr>
<tr> <td valign="bottom" width="99">Gauge</td> <td valign="bottom" width="180">GGE</td></tr>
<tr> <td valign="bottom" width="99">Map</td> <td valign="bottom" width="180">MAP</td></tr>
<tr> <td valign="bottom" width="99">DataBar</td> <td valign="bottom" width="180">DTB</td></tr>
<tr> <td valign="bottom" width="99">Sparkline</td> <td valign="bottom" width="180">SLN</td></tr>
<tr> <td valign="bottom" width="99">Indicatior</td> <td valign="bottom" width="180">IND</td></tr>
</tbody></table>
</div>
Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-63014712505410297112013-01-13T03:18:00.000-08:002013-10-09T08:40:58.255-07:00Best Practice for SSRS report development<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
I have put together a list of best practices for SSRS development based on my experience. Please feel free to add your thoughts<br />
1. Always <b>use the common template</b> to promote a uniform reporting Experience<br />
2. Always <b>convert the complex queries into views</b> and select from the view to produce a result in the report. This will help with your maintenance <br />
· E.g. Any query with more than two Joins will be considered as complex query <br />
3. <b>Don’t use “Select *”</b> in the report query <br />
4. If you require multi stage result building or if you are u<b>sing T-SQL then convert them into Procedures </b>and call the procedure from SSRS <br />
5. Optimise the report Query: Always follow the best practice whilst writing the SQL code. The performance of the query will directly impact the SSRS report performance so tune the query before using it in the reporting <br />
6. <b>Introduce only the necessary parameters</b> as more than 6 parameters will give a poor user experience <br />
7. <b>Assign the default value </b>to most of the parameters by discussing with users <br />
· Remember if you are assign default parameters to all the parameters then the report will get auto loaded when the user select the report. If the execution time is greater than 1 minute then please go for “null” destination snapshot to cache the report. <br />
8. If the user chooses “All” for multi select parameters then don’t send the parameter list, instead send “All” to the SQL and handle it. This will give a great boost to the performance <br />
i. E.g if we have parameter called Branch and if the user chooses “ALL” then in the SQL use where (Branch in (@branch) or 'All' in (@branch)) <br />
9. <b>Don’t retrieve more than what is needed</b>. If the report delivers more than 5-6 pages (or more than 300-400 rows) of data then check with user to deliver them via E-Mail during the offline hours. <br />
<b><br /></b> <br />
<b></b> <br />
<b>10. </b><b>Use all the space </b> <br />
· Profile the data to understand the maximum length required. As a rule of thumb wrap the text and don’t wrap the numbers and dates <br />
· Don’t assign more space than is required for columns <br />
11. Before starting the report <b>set the report width property to one of the standard paper sizes</b>. This will give you an idea of the maximum size you can get (E.g. The width of A3 is 42 cm in Landscape mode) <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnsX01d5719fG7pjpxl66w-tIKJiiYElw3VYv5534TwGi36xw-bpsJl2dUJuxdEZhR1BFyDEjPBaG3yvOG3WtIviWC7RMM7iGrlQGeoP61Pnaqg6FjXVRDC5DdIWBbL6rm-9bilkzWAoc/s1600-h/clip_image002%25255B3%25255D.jpg"><img alt="clip_image002" border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVLtxT-Q3BR5VQ5gWaNhw74am4chs-muN0vJcLHMgTW6j_MEx-ShfnyQ7NoJmP3AFVzqL8pN_LOzi9lgqYETniP7X4m3SP8u_buZX7PFZz6nBiqlkYeGZJ1Mn2uihmcV5J3P7XVFbucdw/?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="clip_image002" width="244" /></a> <br />
12. Once developed <b>export the report into required formats</b> and make sure the users are happy with the extract format <br />
· If the users want to export the report into PDF then make sure the report width fits in a page <br />
· Use the Logical page breaks if needed for rending into different pages (Ex. Pushing each year of account into separate page) <br />
13. If the report looks very lengthy in the report viewer then use soft page breaks via theInteractiveHeight and InteractiveWidth properties. <br />
14. <b>Move the Calculated fields into views</b>. If there are calculated fields in the report then it is better to create them in a view as this will promote two things:- <br />
· Ease of Maintenance <br />
· Less processing load on the report server <br />
<b><br /></b> <br />
<b></b> <br />
<b>15. </b><b>Use the right data type for the parameters</b> <br />
E.g. Use the DateTime data type for date parameters instead of using strings. There are 3 reasons to do this:<br />1) Stop the bug "Cannot read the next data row for the data set"<br />Although a hardcoded string will work, it will not work for all users regional date/time settings.<br />E.g. a string data type parameter with a value of "26/01/2006" is correct for "dd/mm/yyyy", but it is wrong for "mm/dd/yyyy"<br />2) When SQL Reporting Services is using the DateTime data type parameter, it will get the datetime value on the user’s setting (aka the Culture DateTime format).<br />3) The users also get the advantage of a date/time picker control, which automatically works out the correct regional date format. This solves the US/Australian date problem. (i.e. DD and MM are reversed). <br />
<b>16. </b>If your data is getting refreshed via <b>ELT/overnight jobs</b> then please include an additional textbox and label in the header to <b>show the last refreshed date/time.</b> <br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-42841221180378053792012-09-16T15:30:00.000-07:002013-11-06T14:32:05.890-08:00Order by – MDX v.s SQL<p>One of the most used SQL syntax in reporting is Order by, so it is normal to expect a similar functionality in MDX with a simple keyword. </p> <h2><font size="3">How to order the results based on single column in SQL?</font></h2> <p>Let us first execute a simple query against AdventureworksDB</p><pre class="csharpcode"> <span class="kwrd">SELECT</span> geo.City<br /> ,<span class="kwrd">sum</span>(SalesAmount) InternetsalesAmount<br /><span class="kwrd">FROM</span> dbo.FactInternetSales fis<br /> <span class="kwrd">join</span> DimCustomer cus <span class="kwrd">on</span> fis.CustomerKey = cus.CustomerKey<br /> <span class="kwrd">join</span> dbo.DimGeography geo <span class="kwrd">on</span> cus.GeographyKey = geo.GeographyKey<br /> <span class="kwrd">join</span> dbo.DimDate dt <span class="kwrd">on</span> fis.OrderDateKey = dt.DateKey<br /><span class="kwrd">where</span> dt.CalendarYear = 2005<br /> <span class="kwrd">group</span> <span class="kwrd">by</span> geo.City<br /> <span class="kwrd">order</span> <span class="kwrd">by</span> City asc</pre><pre class="csharpcode">The above query filter the records for 2005 and order the results based on city in ascending order</pre><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-LoE9KiVyaKJa5Sb83sRZnBa49bmNaMe4ALkKX8vgFB4oUZG1eAtK6Lu04OdV78NEynOE1R46TnBLC71kFQ7qjVG1h6luBORTp8srgwPY-wZloXCnsIzRIL7oVhXMLtn4Cflq7sxfoDI/s1600-h/image%25255B7%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2azvB5oXCi1h_U_VUrZrS4BpSGiDnrZ2AQi4L4vXpgjpA3WJRd6hOvMPbuAFKD_ORb0Hx5IX359youwQODZKqSCHnebEnti_s2s-ZiSgqAK6nlawclmkRbrNUuLx5o2EBf5Kd2YdHIko/?imgmax=800" width="304" height="279"></a> <br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /></p><br /><h2><font size="3">How to get the similar results in MDX?</font></h2><br /><p>In MDX we need to </p><br /><ul><br /><li>Remove the empty (null) values using non empty function <br /><li>order the values by <br /><ul><br /><li>using the Order function <br /><li>with non hierarchy ascending order (basc) <br /><li>based on the city names derived using membervalue(used to convert the values to string) function.</li></ul></li></ul><pre class="csharpcode"> <span class="kwrd">SELECT</span><br />{ [Measures].[Internet Sales Amount] } <span class="kwrd">ON</span> COLUMNS, <br /><span class="kwrd">order</span>(nonempty( [Customer].[Customer Geography].[City]<br /> , [Measures].[Internet Sales Amount]<br /> )<br /> ,[Customer].[Customer Geography].currentmember.membervalue<br /> ,basc<br /> )<br /><br /><span class="kwrd">ON</span> <span class="kwrd">ROWS</span><br /><span class="kwrd">FROM</span><br />[Adventure Works] <br /><span class="kwrd">WHERE</span><br />( [<span class="kwrd">Date</span>].[Calendar].[Calendar <span class="kwrd">Year</span>].&[2005] ) ;</pre><pre class="csharpcode"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH4UGTPMPqYqRh7ndWY6QWQw9ly2DNqaV4aLxLxN8nU8w8ALOsbL9cNWt3hrc9MD3hQlg_3Q5YOfOWhacOmwY-a5s50MK2UpRvHQPvavrMYqWnaDRTUZWT1fFH7_kzy1daCRShGGnq0S8/s1600-h/image%25255B6%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFb_400OPfZ1jTIUpmS4-C8FkBQQ5E6f8hSNoxBms_O4_UEtvEhznRgp4u1fn55pS9XhaHsb4KPiijpbTyjUojC9UMpC1YYdYRpITDTV6CIl2vAEu8r1PgJ0UQP4P9fITI-W-4w9Pv2To/?imgmax=800" width="299" height="313"></a></pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><h2><font size="3">How to order the results based on multiple columns in SQL?</font></h2><pre class="csharpcode"><span class="kwrd">SELECT</span> geo.City,<span class="kwrd">sum</span>(SalesAmount) InternetsalesAmount<br /><span class="kwrd">FROM</span> dbo.FactInternetSales fis<br /> <span class="kwrd">join</span> DimCustomer cus <span class="kwrd">on</span> fis.CustomerKey = cus.CustomerKey<br /> <span class="kwrd">join</span> dbo.DimGeography geo <span class="kwrd">on</span> cus.GeographyKey = geo.GeographyKey<br /> <span class="kwrd">join</span> dbo.DimDate dt <span class="kwrd">on</span> fis.OrderDateKey = dt.DateKey<br /><span class="kwrd">where</span> dt.CalendarYear = 2005<br /> <span class="kwrd">group</span> <span class="kwrd">by</span> geo.City<br /> <span class="kwrd">order</span> <span class="kwrd">by</span> 2 <span class="kwrd">asc</span>, City asc</pre><pre class="csharpcode"><font color="#666666" face="Trebuchet MS">The above query first sort the results by internetsales amount and if we have the same total amount for multiple cities then they get sorted in ascending order. </font></pre><pre class="csharpcode"><font color="#666666" face="Trebuchet MS"><font style="background-color: #ffff00"><strong><font style="">Note:</font></strong> check the sort order in the order by class, it is internet sales amount followed by city</font></font></pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5cXZkCyxmyeJ5ViyG1-kYaogmdEzXXNPGpEMHnoyxM7NUVkXjuFbY9rGdYKkjKT5TBwDEvkGddHSd3FujnpipxDfy4bA4n7v0WvLpPMD0Z9Rloewa8G9aSYN4AHtfzLcPZnyCBFJ31tU/s1600-h/image%25255B10%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgghPo1lZM5iXpzB1fzyvgaGuWvRVpn0qH1NCZx2aGuYUP2eKKl6d_f50g7sLKSAFRlWqKwqCjwGgsSitgYSaReNRZhghFnW2nG8apVUW5jYx4FWqgqi5faSG3IVqCfwuNrtxphCG4CNKE/?imgmax=800" width="218" height="237"></a></p><br /><h2><font size="3">How to order the results based on multiple columns in MDX?</font></h2><br /><p>In MDX we need to </p><br /><ul><br /><li>Remove the empty (null) values using non empty function <br /><li>order the values by <br /><ul><br /><li>using the Order function <br /><li>in non hierarchy ascending order (basc) <br /><li>based on the city names derived using the membervalue function.</li></ul><br /><li>Order the values by <br /><ul><br /><li>using the Order function <br /><li>with non hierarchy ascending order (basc) <br /><li>based on internet sales amount.</li></ul></li></ul><br /><p> SELECT<br>{ [Measures].[Internet Sales Amount] } ON COLUMNS, <br>order (order(nonempty( [Customer].[Customer Geography].[City], [Measures].[Internet Sales Amount])</p><br /><p> ,[Customer].[Customer Geography].currentmember.membervalue<br> ,basc<br> )<br> ,<br> [Measures].[Internet Sales Amount]<br> ,basc<br> ) <br>ON ROWS<br>FROM<br>[Adventure Works] <br>WHERE<br>( [Date].[Calendar].[Calendar Year].&[2005] ) ;</p><br /><p><font color="#666666" face="Trebuchet MS"><font style="background-color: #ffff00"><strong><font style="">Note:</font></strong> check the sort order, it is city followed by internet sales amount</font></font></p><br /><h2><font size="3">Why should we eliminate the Null values in the MDX query? Won’t that degrade query performance?</font></h2><br /><p>SSAS cubes never store the Null values so it is merely a representation. So by including the Nonempty function you are actually increasing the performance of the query</p><br /><h2><font size="3">Why we are reversing the order of columns in MDX?</font></h2><br /><p><strong>In SQL</strong> we are using a single order by keyword which accepts multiple columns. It orders the results by first column and if the values are same then it further order the rows based on second column. So in our example the results are ordered by internet salesamount and when the values are same (e.g 3374.99) it has further been ordered by CIty</p><br /><p><strong>In MDX</strong> we are using two order by function, so we are ordering the results twice. The query works only because of the stable sort algorithm which is used in MDX order function </p><br /><p>E.g. let us use <a href="http://en.wikipedia.org/wiki/Bubble_sort">Bubble sort</a> to prove this theory</p><br /><p>In the below example I have already sorted the results by City and using the bubble sort to sort the results based on Amount.</p><br /><p>Bubble sort is a stable sort and as you can see, whenever amount are equal between multiple rows, it remember and retain the position of pre-Sorted CITY order.</p><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNeG1P1I7t3C9I36GOs1651FNP1sCGCFjD75a3wC7CmkyDKy7pvKTtxkPsJX5aVSysElZSfIHm6vQGsXfmGq4Trm881uRN_JMC5CKnVV3OjByj4Qx_BsqQ2mwo2RDHJpTOxYdD7fAaDbg/s1600-h/wsrd3tzw%25255B3%25255D.jpg"><img title="wsrd3tzw" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="wsrd3tzw" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs3_ELp2If4Rkuv3pqr_NUpiD6bpbhtR2U_Ml3A6jfka0P0XfWlUi7WIhGY4p8cZ9NHnEyaRD_lDisugH2GPCprT3hjLke25VczUwSQDE9fygL6aT9kwuE8NRbixWGtz3GFYQsTdqFnNw/?imgmax=800" width="803" height="134"></a></p> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0tag:blogger.com,1999:blog-3190166579815746224.post-73976947622880097892012-08-12T10:56:00.000-07:002013-11-02T11:09:22.830-07:00MDX Wildcard search in parameters dropdown -- SSRS<p> </p> <p>Recently I got a request from my insurance client to filter the SSRS MDX report based on the Policy holder, one choice is to give them the complete list but as we have more than 5,000 policy holders(that is only commercial insurance), it is really impossible for them to choose even with alphabetical ordered list</p> <p>As the Google search has become the norm, we want to implement wildcard dropdown boxes where user can type in the partial name of the policy holder and then choose one/multiple items. Unfortunately SSRS dropdown parameter list doesn't support the wild card search. So we implemented it via cascaded parameters.</p> <p>To mimic the problem let us search the Employee dimension in the Adventureworks cube</p> <h2><font size="4"><font style="font-weight: normal">let us first implement the wild card search in MDX. </font></font></h2> <p>There is no direct equivalent of SQL LIKE operator is available in MDX but we can use one of the below methods to achieve wildcard search</p> <ul> <li>Using Custom library . </li> <ul> <li>Check the below link . You can use the LIkeMember function </li> <li><a href="http://asstoredprocedures.codeplex.com/">http://asstoredprocedures.codeplex.com/</a></li></ul> <li>Other easy method is to use VBA instr function to search the member value and filter the dimension list</li></ul> <p>So if i want to filter all the Employees whose first/middle/last name is David then the query would like below</p><pre class="csharpcode"> <span class="kwrd">SELECT</span> { } <span class="kwrd">ON</span> COLUMNS<br /> , FILTER(<br /> [Employee].[Employees].members,<br /> vbamdx!INSTR([Employee].[Employees].CURRENTMEMBER.Name,<span class="str">'David'</span>,1 >= 1 )<br /> ) <span class="kwrd">on</span> <span class="kwrd">rows</span><br /> <span class="kwrd">FROM</span> [Adventure Works]</pre><br /><p>The above query search for David using the Instr function. if the instr function found the match then will return the position of David string which will be either 1 or greater than 1 . If there is no match found then it will return Zero. We then can use this as the logical expression in the filter function to get the subset of interested employees.</p><br /><p>In order to use this query in SSRS we need to include member properties as shown below. Also replace static name ‘David’ with suitable parameter name</p><pre class="csharpcode"> <span class="kwrd">SELECT</span> { } <span class="kwrd">ON</span> COLUMNS<br /> , FILTER(<br /> [Employee].[Employees].members,<br /> vbamdx!INSTR([Employee].[Employees].CURRENTMEMBER.Name<font style="background-color: #ffff00">,@EmplyeeName</font>,1 >= 1 )<br /> ) DIMENSION PROPERTIES <br /> MEMBER_CAPTION, <br /> MEMBER_UNIQUE_NAME, <br /> PARENT_UNIQUE_NAME, <br /> LEVEL_NUMBER <span class="kwrd">ON</span> <span class="kwrd">ROWS</span> <br /> <span class="kwrd">FROM</span> [Adventure Works] CELL PROPERTIES VALUE</pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><p>Final solution will look like blow. </p><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBr9myJtJWGAJYkUEY42tTvh2cKgxdVehCJp76Dpu2vMF-MRgBS9XDrGsLmMehUbubuoDU7gWZEGf70qC4F1VahowyLiXy0FPf_SmAQXDjrjsHSpG02mnbtvKJzYnzZP1n7ctsZ14Oxcg/s1600-h/image%25255B21%25255D.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1rBNlO6oKIixSUPoy0qiEfFpHYa6ZD5nNrh5wTF-7e5W6X6I1_v5_KmDN6vPrXdBs8xXJV_SHaUy7dPpg0VsIogfyu2CfpUgYtvrSzPsg0jYNzFVAQpUt41iGSqAPoY_VhqJJzk7PLow/?imgmax=800" width="799" height="319"></a></p><br /><p>As you can see, using the cascaded parameters and MDX wildcard search, we can limit the list of employees. If you want to allow the user to select multiple employees then select the “Allow Multiple Values” in the parameter properties.</p><br /><br /><p>Happy Reading <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkSibZ6nJY-SKE4vZeztAogdf1Q2w19AXYDsRclVPwYfMrBHv9T1hHkb5lPVCLaVTC4709ngHnNY12vErJcYrSclBVHmMLyGAlwbo50BSfUvDdFIGlUQTxkq41cIC6jGxsnd9z7FyKORI/?imgmax=800"></p> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com1tag:blogger.com,1999:blog-3190166579815746224.post-12790977056087914382012-07-22T08:29:00.000-07:002013-10-10T10:27:02.882-07:00MDX - Use formatting to change the Null values into other Characters<p> </p> <p>Have you ever used the If statement to convert the null into some special character mainly for Excel based reports? If then there is no need for it, you can easily achieve this via formatting</p> <h3>Let us first do this in a wrong way</h3> <p>In the below code I am checking for null values and if it is null then replace it with “–” . It works perfectly fine and it can be directly linked with excel reports and handed over to users</p> <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"> <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">with</span> member measures.[Reseller Sales Amount Formatted] <span style="color: #0000ff">as</span></pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">iif( isempty([Measures].[Reseller Sales Amount]) ,"-",[Measures].[Reseller Sales Amount])</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">Select</span> {[Measures].[Reseller Sales Amount], measures.[Reseller Sales Amount Formatted] }<span style="color: #0000ff">on</span> 0</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ,[<span style="color: #0000ff">Date</span>].[Calendar].[<span style="color: #0000ff">Date</span>].members </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> * </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> [Geography].[Geography].[<span style="color: #0000ff">State</span>-Province].members <span style="color: #0000ff">on</span> 1</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">from</span> [Adventure Works]</pre><!--CRLF--></div></div><br /><p>This has clearly produces the required result as shown below, </p><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxuHkXCtTplhWwQpvRE26BmNS8OUv6IaaSTbtKO8jCwPX7noiAGzRxHHkW3iuB_vQ1hhgwRd4IiZHoIzmtygmmdxPCz55lHY5hZjGB6WPXIBqpa9mABXVrJ-iIvqibMx5Rvhri5IYFfDQ/s1600-h/image%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvVQNn-vULEBz_CcIQ6j8x14MeqpUhc-LVuvPg1kRGQ07Et9sX_o7qF4TSZCI9FK13DrJaW-uOMikA90VHPzxtU22cO248lau9-pwp8_b4NN3iYWVp3Fpxn3go-HIrhwaZ1TCmFleVNDo/?imgmax=800" width="296" height="221"></a></p><br /><h3>What is the best way then?</h3><br /><p>Though this is correct in terms of results there is a simpler way of doing this with format_String as shown below</p><br /><div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"><br /><div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">with</span> member measures.[Reseller Sales Amount Formatted] <span style="color: #0000ff">as</span></pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">[Measures].[Reseller Sales Amount], FORMAT_STRING = "$#,##.00;($#,##.00);$#,##.00;-"</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">Select</span> {[Measures].[Reseller Sales Amount], measures.[Reseller Sales Amount Formatted] }<span style="color: #0000ff">on</span> 0</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ,[<span style="color: #0000ff">Date</span>].[Calendar].[<span style="color: #0000ff">Date</span>].members </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> * </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> [Geography].[Geography].[<span style="color: #0000ff">State</span>-Province].members <span style="color: #0000ff">on</span> 1</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">from</span> [Adventure Works]</pre><!--CRLF--></div></div><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUODyO36G6CdVCRHFZPEj4caaZZHX2vtBIjNG9njTJGgR-aLAVXMGiY-g6TXBzunpXq26Mlv1k-i9Hen45oN4XclT5q4jn35N8r0h22FMk3oefPDQrHfZVMJyCaJDkJRBGSm555I5qeoE/s1600-h/image%25255B7%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtoEGVmpGqVzzoFyY2RiMzC_elxI0tVsfLqRSIOdOVz2z13esr62X8QDtgSzGvkAwH7HziGrWeGjeaNPIkSE3HRCOKrUjZiyASJTGKqgEJKUbPV7UuO-VptBgQg_gLYXfRCja0JvI5Xg0/?imgmax=800" width="387" height="288"></a></p><br /><h3>So, Are we only talking about Aesthetic reasons here? </h3><br /><p>Actually no. Using the format option gives you lot of performance advantage in complex queries especially in Crosstab report.</p><br /><p>E.g. Test the below query it takes around 30 seconds</p><br /><div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"><br /><div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">with</span> member measures.[Reseller Sales Amount Formatted] <span style="color: #0000ff">as</span></pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">iif( isempty([Measures].[Reseller Sales Amount]) ,"-",[Measures].[Reseller Sales Amount])</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">Select</span> [Geography].[Geography].[<span style="color: #0000ff">State</span>-Province].members <span style="color: #0000ff">on</span> 0</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"> ,[<span style="color: #0000ff">Date</span>].[Calendar].[<span style="color: #0000ff">Date</span>].members <span style="color: #0000ff">on</span> 1</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">from</span> [Adventure Works]</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">where</span> measures.[Reseller Sales Amount Formatted</pre><!--CRLF--></div></div><br /><p>Just change it with format option, it will get executed under 5 seconds and that should convince you. </p><br /><p>Happy Reading <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwQZHcHo4_ce4qGG7Vq2UpRZkiWS_omGSRLztivkEjcs-1MZ8k3U7HMNrchBQQwkiey3im0E40nsMpIFJakl2CeJ-6DbLhi_RKaxZBWAvUEhN5UrVgN79R3f13L3cj0Oo92Y81I2Rmw5A/?imgmax=800"></p> Nisharhttp://www.blogger.com/profile/03151449590672654447noreply@blogger.com0