<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tech Updates</title>
	<atom:link href="http://munishbansal.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://munishbansal.wordpress.com</link>
	<description>...keep in pace with technology !</description>
	<lastBuildDate>Tue, 24 Jan 2012 08:17:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='munishbansal.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tech Updates</title>
		<link>http://munishbansal.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://munishbansal.wordpress.com/osd.xml" title="Tech Updates" />
	<atom:link rel='hub' href='http://munishbansal.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Dynamic Named Sets in SQL Server 2008 Analysis Services (SSAS 2008)</title>
		<link>http://munishbansal.wordpress.com/2010/05/05/dynamic-named-sets-in-sql-server-2008-analysis-services-ssas-2008/</link>
		<comments>http://munishbansal.wordpress.com/2010/05/05/dynamic-named-sets-in-sql-server-2008-analysis-services-ssas-2008/#comments</comments>
		<pubDate>Wed, 05 May 2010 11:31:16 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SSAS 2008]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=440</guid>
		<description><![CDATA[Introduction: SSAS is having a nice &#38; useful feature of defining the calculations (Calculated Members &#38; Named Sets). These calculations can then be used in MDX or by any other client tools etc. These calculations come very handy to allow the user to use them to analyse their data with required parameters, attributes, &#38; custom [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=440&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3><span style="color:#008000;"><span style="text-decoration:underline;">Introduction:</span></span></h3>
<p>SSAS is having a nice &amp; useful feature of defining the calculations (<em>Calculated Members &amp; Named Sets</em>). These calculations can then be used in MDX or by any other client tools etc. These calculations come very handy to allow the user to use them to analyse their data with required parameters, attributes, &amp; custom calculations. Using Named Sets, we can predefine the member(s) which are based upon certain conditions and then user can directly use them to see the measure/data against those members.</p>
<p>Let’s say we want to offer the user with a set of last 5 days/dates which contains transactional data, even though there may be lot of other later dates but with no fact data.</p>
<p>So for this we can create a regular Named Set on Calculation tab, something like:</p>
<p> <span style="color:#0000ff;">CREATE SET </span>ActualSalePeriods <span style="color:#0000ff;">AS</span></p>
<p><span style="color:#993300;">Tail</span></p>
<p>(      <span style="color:#993300;">NonEmpty</span>([Date Order].[Calendar].[Month].[Date].<span style="color:#0000ff;">Members</span>,</p>
<p>                        Measures.[Sales Amount]),</p>
<p>5);  </p>
<p> <strong><em>Every calculated member/named set created here is session scoped &amp; created with keyword ‘Create’ behind the scene</em></strong><em>.</em></p>
<p> These Named Sets are evaluated and created every time the cube is processed so at the time of next process, if cube gets data with new dates, it will refresh the result set of this create Named Set as well accordingly. So we can say, they are static is nature and contents will remain intact until cube is reprocessed.</p>
<h3><span style="color:#0000ff;"><span style="text-decoration:underline;">Dynamic Named Set:</span></span></h3>
<p>These regular Named Sets are Static in Nature (<strong><em>only possible option till 2005 version</em></strong>) to improve the query performance by not automatically refreshing/querying it against cube every time. And in fact, works well in the situations like getting latest 5 dates as mentioned above since as in when new dates get added with data in the cube, it will be reprocessed &amp; above set would also be updated with latest members then.</p>
<p>However, this may result a serious issue with respect to the actual requirement which (let’s say) is to get the latest Top 10 employees with highest sales on monthly basis. Created Named Set (static), evaluated at the time of processing, will give the correct result set with those employees. But now in case user wants to slice/dice the result set based upon some other dimension say region, product etc, again user will be offered with the same result set generated earlier at the time of processing, i.e. wrong data information.</p>
<p> To cope up with such issues/requirements, SSAS 2008 has come up with one more option for creating the Named Set. It’s named as ‘Dynamic’. So developer can either select Static (default) to have the regular Named Set or can select Dynamic to give the Named Set a dynamic behaviour. And by selecting Dynamic option, SSAS will add a keyword ‘Dynamic’ before SET keyword to make it dynamic named set.</p>
<p>Dynamic sets are not calculated once. <strong>They are calculated before each &amp; every query, and very important, in the context of that&#8217;s query WHERE clause and sub-selects.</strong><strong> </strong></p>
<p>Thus the above requirement of getting Top 10 sales employees will work absolutely fine with Dynamic Named Set.</p>
<p><span style="color:#ff0000;"><strong> <em><span style="text-decoration:underline;">Imp:</span></em></strong></span> Dynamic named set not only resolves the above mentioned issue but also adds capability to MDX which was not able to generate the desired results with regular named set. This is in regards with the issue while using the multi-select dimensions in the sub-select rather than where clause (which is case with excel wherein it always converts where to sub-select). So using Dynamic sets, multi-select statements are evaluated properly even being used in sub-select statements.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/440/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=440&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2010/05/05/dynamic-named-sets-in-sql-server-2008-analysis-services-ssas-2008/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>
	</item>
		<item>
		<title>How to remove duplicate records from Flat File Source (SSIS)</title>
		<link>http://munishbansal.wordpress.com/2010/04/21/how-to-remove-duplicate-records-from-flat-file-source-ssis/</link>
		<comments>http://munishbansal.wordpress.com/2010/04/21/how-to-remove-duplicate-records-from-flat-file-source-ssis/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:31:11 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=414</guid>
		<description><![CDATA[Problem: Since populating the data warehouse or any other database may involve various disparate source-types like SQL Server, Excel spreadsheets, DB2 etc. It can also be a Flat File/CSV file source as well.  In case of data sources like SQL Server, Oracle wherein we generally get the data by querying the tables, views etc, we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=414&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration:underline;"><span style="color:#993300;">Problem:</span></span></p>
<p>Since populating the data warehouse or any other database may involve various disparate source-types like SQL Server, Excel spreadsheets, DB2 etc. It can also be a Flat File/CSV file source as well. </p>
<p>In case of data sources like SQL Server, Oracle wherein we generally get the data by querying the tables, views etc, we can actually put the logic to remove the duplicate probably by selecting the DISTINCT values or so. But in case of a Flat File data source we don’t have much control in terms of querying the data from it and still we want the duplicate records to be removed before loading them into the target database/file.</p>
<p><span style="color:#008000;"> <span style="text-decoration:underline;">Solution:</span></span></p>
<p>Let’s take an example where we have a flat file with four columns (A,B,C,D) and some records (100,200,300,400 etc) as shown below:</p>
<p> <em><span style="text-decoration:underline;">Source File</span></em></p>
<p><span style="color:#993300;"><a href="http://munishbansal.files.wordpress.com/2010/04/1.jpg"><img class="alignleft size-full wp-image-415" title="1" src="http://munishbansal.files.wordpress.com/2010/04/1.jpg?w=500" alt=""   /></a></span></p>
<p><span style="color:#993300;"> </span></p>
<p><span style="color:#993300;"> </span></p>
<p><span style="color:#993300;"> </span></p>
<p><span style="color:#993300;"> </span></p>
<p>And now say we want all of the columns to be loading into the target database, but with duplicate records (lines) removed.</p>
<p><em><span style="text-decoration:underline;">Approach:</span></em></p>
<p><a href="http://munishbansal.files.wordpress.com/2010/04/2.jpg"><img class="alignleft size-full wp-image-416" title="2" src="http://munishbansal.files.wordpress.com/2010/04/2.jpg?w=500" alt=""   /></a></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><span style="text-decoration:underline;">Steps:</span></p>
<p>1. Configure the Flat File Source as we required by selecting the file, delimiters (columns &amp; header) etc.</p>
<p>2. Now drag ‘<strong>Aggregate</strong>’ transformation following Flat File Source and configure it to have ‘Group By’ on the deciding columns/fields for the record to be unique.</p>
<p><a href="http://munishbansal.files.wordpress.com/2010/04/3.jpg"><img class="alignleft size-full wp-image-418" title="3" src="http://munishbansal.files.wordpress.com/2010/04/3.jpg?w=500" alt=""   /></a></p>
<p>3. Configure destination by mapping the columns from Aggregate transformation to the target database/file.</p>
<p>Run the package, and you will see no duplicate record inserted into the target database/file.</p>
<p><em><span style="text-decoration:underline;">Dest File</span></em></p>
<p><a href="http://munishbansal.files.wordpress.com/2010/04/4.jpg"><img class="alignleft size-full wp-image-419" title="4" src="http://munishbansal.files.wordpress.com/2010/04/4.jpg?w=500" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/414/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=414&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2010/04/21/how-to-remove-duplicate-records-from-flat-file-source-ssis/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/04/1.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/04/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/04/3.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/04/4.jpg" medium="image">
			<media:title type="html">4</media:title>
		</media:content>
	</item>
		<item>
		<title>How to draw a line based upon data values in Dundas Chart – Customizing Dundas Chart using Code Editor (SSRS)</title>
		<link>http://munishbansal.wordpress.com/2010/02/23/how-to-draw-a-line-based-upon-data-values-in-dundas-chart-%e2%80%93-customizing-dundas-chart-using-code-editor-ssrs/</link>
		<comments>http://munishbansal.wordpress.com/2010/02/23/how-to-draw-a-line-based-upon-data-values-in-dundas-chart-%e2%80%93-customizing-dundas-chart-using-code-editor-ssrs/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 12:41:46 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=401</guid>
		<description><![CDATA[Introduction: Dundas has come up with the adding new abilities to Reporting Services (SSRS) in terms of more featured &#38; customizable controls. Not only they look better with lot of UI options to customize, but also have powerful features which are very interesting and useful for analysis. The most popular among these is Dundas Chart [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=401&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;"><strong><span style="text-decoration:underline;"><span style="color:#000080;">Introduction:</span></span></strong></p>
<p style="text-align:left;">Dundas has come up with the adding new abilities to Reporting Services (SSRS) in terms of more featured &amp; customizable controls. Not only they look better with lot of UI options to customize, but also have powerful features which are very interesting and useful for analysis. The most popular among these is <strong>Dundas Chart</strong> control. Existing SSRS charts can also be into Dundas chart just by few right clicks.</p>
<p style="text-align:left;">Though there are lot of in-built options to select which are quite enough to fulfil the reporting requirements, it also lets developer to apply his/her imagination in designing the chart with the help of writing custom code. And this can be done using the <strong>Code Editor</strong> of the Dundas control. It provides some event handlers wherein .net (C#/Vb.net) code can be put as per the requirement e.g. <strong>PostPaint, PostApplyData, CustomizeChart, CustomizeLegend </strong>etc. These are called at some specific point in time &amp; serve a specific purpose.</p>
<p style="text-align:left;"><strong><span style="text-decoration:underline;"><span style="color:#000080;">Drawing a line on Dundas chart for some specific values:</span></span></strong></p>
<p style="text-align:left;">Here we will try to understand the use of Code Editor in Dundas chart with the help of a very simple example. There may be some business need to show a line or any shape based upon certain data conditions on the chart. <strong><em>You need to be a little bit familiar with the .net coding as well.</em></strong></p>
<p style="text-align:left;">We will take a simple dataset with some dummy values. </p>
<address>DataSet: <strong>DS_Chart</strong></address>
<address>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</address>
<address>SELECT     1000 AS Value, 1 AS Rate</address>
<address>UNION</address>
<address>SELECT     1400 AS Value, 1.5 AS Rate</address>
<address>UNION</address>
<address>SELECT     2100 AS Value, 2 AS Rate</address>
<address>UNION</address>
<address>SELECT     1450 AS Value, 2.75 AS Rate</address>
<address>UNION</address>
<address>SELECT     2300 AS Value, 3 AS Rate</address>
<address>UNION</address>
<address>SELECT     3400 AS Value, 3.5 AS Rate</address>
<address>UNION</address>
<address>SELECT     2340 AS Value, 4 AS Rate</address>
<address>UNION</address>
<address>SELECT     4440 AS Value, 4.5 AS Rate</address>
<address>UNION</address>
<address>SELECT     4200 AS Value, 5.5 AS Rate</address>
<address>UNION</address>
<address>SELECT     3400 AS Value, 6 AS Rate</address>
<address>UNION</address>
<address>SELECT     9600 AS Value, 6.5 AS Rate</address>
<address>UNION</address>
<address>SELECT     5300 AS Value, 7 AS Rate</address>
<address>UNION</address>
<address>SELECT     5600 AS Value, 9 AS Rate</address>
<address> Order By Rate</address>
<address>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</address>
<p>The idea is to draw a line chart wherein value (Y-axis) will change overt the rate (X-axis). First we will configure the Dundas Chart control for a basic chart requirement.</p>
<ol>
<li>Right click the control &amp; select properties.</li>
<li>Give a title to the chart &amp; go to Data tab.</li>
<li>Select ‘DS_Chart’ as dataset.</li>
<li>Add a Value series and there select
<ol>
<li>rate on X-axis</li>
<li>sum(value) on Y-axis.</li>
</ol>
</li>
</ol>
<p><a href="http://munishbansal.files.wordpress.com/2010/02/datatab.jpg"><img class="alignleft size-full wp-image-402" title="DataTab" src="http://munishbansal.files.wordpress.com/2010/02/datatab.jpg?w=500" alt=""   /></a></p>
<ol>
<li>5. Add one CategoryGroup with Expression as Rate &amp; label as also Rate.</li>
</ol>
<p><a href="http://munishbansal.files.wordpress.com/2010/02/categorygroup.jpg"><img class="alignleft size-full wp-image-403" title="CategoryGroup" src="http://munishbansal.files.wordpress.com/2010/02/categorygroup.jpg?w=500&#038;h=498" alt="" width="500" height="498" /></a></p>
<p>6. Click Ok. Go to Preview tab to see the report. It will look a like as:</p>
<p><a href="http://munishbansal.files.wordpress.com/2010/02/defaultchart1.jpg"><img class="alignleft size-full wp-image-406" title="DefaultChart" src="http://munishbansal.files.wordpress.com/2010/02/defaultchart1.jpg?w=500&#038;h=250" alt="" width="500" height="250" /></a></p>
<p><strong>Now adding the custom code where 3 &lt; Rate &gt; 4 &amp; Value &gt; 3000.</strong></p>
<p><strong> 7. </strong>Go to properties and click on Advanced tab.</p>
<ol>
<li>8. Click on ViewCode button there.</li>
<li>9. Select <strong>PostPaint</strong> event &amp; put the below code inside the code editor.</li>
</ol>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:green;font-size:10pt;">// Chart Graphics object</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">ChartGraphics graphics = e.ChartGraphics;               </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:green;font-size:10pt;">// Check what chart element fired the event</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">if</span><span style="font-family:'Courier New';font-size:10pt;">(sender <span style="color:blue;">is</span> Series ){</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      Series series = (Series) sender;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">                </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      <span style="color:green;">//Can also check for the series name using series.Name property</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">            <span style="color:blue;">double</span> xValue;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">        <span style="color:blue;">double</span> yValue;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">        </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">        <span style="color:green;">// Data points loop</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      <span style="color:blue;">foreach</span>( DataPoint point <span style="color:blue;">in</span> series.Points ){</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">        <span style="color:green;">// Get relative position of the point, which will be the center of the ellipse.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      xValue = graphics.GetPositionFromAxis( <span style="color:#a31515;">&#8220;Default&#8221;</span>, AxisName.X, point.XValue);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      yValue = graphics.GetPositionFromAxis( <span style="color:#a31515;">&#8220;Default&#8221;</span>, AxisName.Y, 0);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      <span style="color:green;">// Get absolute point.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      PointF absPoint = graphics.GetAbsolutePoint( <span style="color:blue;">new</span> PointF( (<span style="color:blue;">float</span>)xValue, (<span style="color:blue;">float</span>)yValue ) );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">       <span style="color:green;">//Draw a line for data</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">       <span style="color:blue;">if</span>(point.YValues[0] &gt; 3000 &amp;&amp; (point.XValue &gt; 3 &amp;&amp; point.XValue &lt; 4))</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">       {</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">            Pen blackPen = <span style="color:blue;">new</span> Pen(Color.Black, 3);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">            PointF endPoint = graphics.GetAbsolutePoint( <span style="color:blue;">new</span> PointF((<span style="color:blue;">float</span>)xValue, (<span style="color:blue;">float</span>)40) );</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">            graphics.DrawLine(blackPen, absPoint,endPoint);</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">       }</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">     </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;">      }    </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';font-size:10pt;"> </span><span style="font-family:'Courier New';font-size:10pt;">}</span></p>
<p class="MsoNormal" style="margin:0;"> </p>
<p>10. Click Ok.</p>
<p>11. Now go to Preview tab to see the report. It will look similar to the following:</p>
<p><a href="http://munishbansal.files.wordpress.com/2010/02/withcode.jpg"><img class="alignleft size-full wp-image-409" title="WithCode" src="http://munishbansal.files.wordpress.com/2010/02/withcode.jpg?w=500&#038;h=249" alt="" width="500" height="249" /></a></p>
<p>As shown, a line has been drawn at the specified condition’s location.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/401/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=401&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2010/02/23/how-to-draw-a-line-based-upon-data-values-in-dundas-chart-%e2%80%93-customizing-dundas-chart-using-code-editor-ssrs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/02/datatab.jpg" medium="image">
			<media:title type="html">DataTab</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/02/categorygroup.jpg" medium="image">
			<media:title type="html">CategoryGroup</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/02/defaultchart1.jpg" medium="image">
			<media:title type="html">DefaultChart</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/02/withcode.jpg" medium="image">
			<media:title type="html">WithCode</media:title>
		</media:content>
	</item>
		<item>
		<title>Extending SQL Server Reporting Services 2005 with Custom Data Extensions (SSRS)</title>
		<link>http://munishbansal.wordpress.com/2010/02/18/extending-sql-server-reporting-services-2005-with-custom-data-extensions-ssrs/</link>
		<comments>http://munishbansal.wordpress.com/2010/02/18/extending-sql-server-reporting-services-2005-with-custom-data-extensions-ssrs/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 12:10:57 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=388</guid>
		<description><![CDATA[Custom Data Processing   There are many components of SQL Server reporting services which can be customized as per the requirements &#38; one of them is how data is being fetched/processed. Though, SSRS provides quite a good number of inbuilt data providers to connect to various types of data sources (inbuilt data processing extensions), there may [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=388&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration:underline;"><span style="color:#333399;">Custom Data Processing</span></span></strong> </p>
<p><strong><span style="text-decoration:underline;"><span style="color:#333399;"> </span></span></strong>There are many components of SQL Server reporting services which can be customized as per the requirements &amp; one of them is how data is being fetched/processed. Though, SSRS provides quite a good number of inbuilt data providers to connect to various types of data sources (inbuilt data processing extensions), there may be a need to do some custom processing before the data actually gets delivered to SSRS report. </p>
<p>Also sometimes one may have requirement to merge/join data from multiple data sources (say from a RDMS database &amp; from a cube), which at the first sight looks like a limitation of SSRS. But there is what it offers the facility to extend the services by implementing a Custom Data Extension. </p>
<p> Well by CDE, it means you can write your own custom code (in .net) which will take the dataset query as its input and will give you the result-set as per the custom logic implemented in the CDE code. So basically doing so we are extending/customizing the ‘<strong>Data Processing Extension’</strong> </p>
<p> For creating the custom libarary for it there are certain interfaces which need to be implementing. </p>
<p>These include:   </p>
<ul>
<li>IDbConnection</li>
<li>IExtension</li>
<li>IDbCommand</li>
<li>IDataParameter</li>
<li>IDataParameterCollection</li>
<li>IDataReader</li>
<li>IDbTransaction</li>
</ul>
<p>Details about Required Extensions: <span style="color:#333399;"> </span><a href="http://msdn.microsoft.com/en-us/library/ms153967.aspx"><span style="color:#333399;">http://msdn.microsoft.com/en-us/library/ms153967.aspx</span></a> </p>
<p><strong><span style="text-decoration:underline;"><span style="color:#333399;">Data Extension Process Flow</span> </span></strong> </p>
<p>Before developing your custom data extension, you should understand how the report server uses data extensions to process data. You should also understand the constructors and methods that are called by the report server. </p>
<p><span style="color:#333399;"> <strong>The step-by-step process flow of a data extension that is called by the report server</strong></span> </p>
<p><span style="color:#333399;"><a href="http://munishbansal.files.wordpress.com/2010/02/processflow.jpg"><img class="alignleft size-full wp-image-390" title="ProcessFlow" src="http://munishbansal.files.wordpress.com/2010/02/processflow.jpg?w=500" alt=""   /></a></span> </p>
<p>Also there are certain dll references to be added in the library solution: </p>
<ul>
<li>Microsoft.ReportingServices.DataExtension</li>
<li>Microsoft.ReportingServices.Interfaces</li>
</ul>
<p><strong><span style="text-decoration:underline;">Implemention of various Interfaces and their methods/properties:</span></strong> </p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="135" valign="top"><strong>Class</strong> </td>
<td width="211" valign="top"><strong>Implements Interface </strong> </td>
<td width="222" valign="top"><strong>Description</strong> </td>
</tr>
<tr>
<td rowspan="7" width="135" valign="top">Connection class </td>
<td width="211" valign="top">IDbConnection, IExtension </td>
<td width="222" valign="top">This is the entry point of the data extenson. </td>
</tr>
<tr>
<td width="211" valign="top">Methods<strong> – IExtension</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td width="211" valign="top">SetConfiguration(string config) </td>
<td width="222" valign="top">For getting the connections defined in RSReportDesigner.config and using them in the code. The whole xml string gets passed from SSRS. </td>
</tr>
<tr>
<td width="211" valign="top">Methods &#8211; <strong>IDbConnection</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td width="211" valign="top">Open()<strong> </strong> </td>
<td width="222" valign="top">Called at the beginning to open the required db connections. </td>
</tr>
<tr>
<td width="211" valign="top">CreateCommand() </td>
<td width="222" valign="top">Called to create an object of IDbCommand to form the command to be executed. </td>
</tr>
<tr>
<td width="211" valign="top">Close() </td>
<td width="222" valign="top">To close the connections at the end. </td>
</tr>
<tr>
<td width="135" valign="top">Command Class </td>
<td width="211" valign="top"><strong>Implements Interface</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td rowspan="7" width="135" valign="top">  </td>
<td width="211" valign="top">IDbCommand, IDbCommandAnalysis (optional)<strong> </strong> </td>
<td width="222" valign="top">This class takes care of preparing the command based upon the commandtext/query passed from the report dataset &amp; retruns the resultset in the form of DataReader. </td>
</tr>
<tr>
<td width="211" valign="top">Methods &#8211; <strong>IDbCommand</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td width="211" valign="top">CreateParameter() </td>
<td width="222" valign="top">Creates a new instance of an <a href="http://msdn.microsoft.com/en-us/library/system.data.idbdataparameter(VS.71).aspx">IDbDataParameter</a> which takes care of parameters valuations. </td>
</tr>
<tr>
<td width="211" valign="top">ExecuteReader() </td>
<td width="222" valign="top">To prepare the resultset based upon the parameters and the query passed. </td>
</tr>
<tr>
<td width="211" valign="top">CommandText : Property </td>
<td width="222" valign="top">This gives the command/query passed from report dataset. </td>
</tr>
<tr>
<td width="211" valign="top">Methods &#8211; <strong>IDbCommandAnalysis</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td width="211" valign="top">IDataParameterCollection GetParameters() </td>
<td width="222" valign="top">This method creates a collection (IDataParameterCollection) of IDataParameters. We can also write our own logic here to prepare the IDataParamCollection and return. </td>
</tr>
<tr>
<td width="135" valign="top">Parameter Class </td>
<td width="211" valign="top"><strong>Implements Interface</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td width="135" valign="top">  </td>
<td width="211" valign="top">IDataParameter </td>
<td width="222" valign="top">This contains some functions like ‘Value’ to get the value of a parameter. </td>
</tr>
<tr>
<td width="135" valign="top">Parameter Collection </td>
<td width="211" valign="top"><strong>Implements Interface</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td width="135" valign="top">  </td>
<td width="211" valign="top">IDataParameterCollection<strong> </strong> </td>
<td width="222" valign="top">This contains the function like ‘Add’ to add the parameters to a collection and contains properties like ‘IndexOf’ to get/set the index in the collection. </td>
</tr>
<tr>
<td width="135" valign="top">Data Reader Class </td>
<td width="211" valign="top"><strong>Implements Interface</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td rowspan="2" width="135" valign="top">  </td>
<td width="211" valign="top">IDataReader<strong> </strong> </td>
<td width="222" valign="top">This class comes into picture when ‘<strong>ExecuteReader</strong>’ method is being executed. This method works in conjection with the DataReader class to form a resultset. </td>
</tr>
<tr>
<td width="211" valign="top">Methods – <strong>GetName(), GetOrdinal(), GetValue()</strong> <strong>&amp; Read()</strong> etc </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td width="135" valign="top">Transaction Class </td>
<td width="211" valign="top"><strong>Implements Interface</strong> </td>
<td width="222" valign="top">  </td>
</tr>
<tr>
<td width="135" valign="top">  </td>
<td width="211" valign="top">IDbTransaction </td>
<td width="222" valign="top">To handle transactions. </td>
</tr>
</tbody>
</table>
<p>Once the data extension library (.dll) is compiled, it has to be placed into foler at: <strong>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies</strong> </p>
<p><strong><span style="text-decoration:underline;"><span style="color:#000080;">Registering the CDE with report designer &amp; making SSRS report datasource able to access the CDE (RSReportDesigner.Config &amp; RSReportServer.config)</span></span></strong> </p>
<p> <em>(Generic names are used here) </em></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">Extension</span><span style="font-family:'Courier New';color:blue;font-size:10pt;"> </span><span style="font-family:'Courier New';color:red;font-size:10pt;">Name</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">=</span><span style="font-family:'Courier New';font-size:10pt;">&#8220;<span style="color:blue;">MyExtension</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">Type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">NameSpacename.ClassImplementingIDbConnection, AssemblyName</span>&#8220;<span style="color:blue;">&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">Configuration</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">connections</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">description</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;&lt;</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">environment</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;<strong>MyCustomExtension </strong>&lt;/</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">environment</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;&lt;/</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">description</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">connectionstring</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">    &lt;</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">name</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span><span style="font-family:'Courier New';font-size:10pt;">connectionname1<span style="color:blue;">&lt;/</span><span style="color:maroon;">name</span><span style="color:blue;">&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">    &lt;</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">value</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span><span style="font-family:'Courier New';font-size:10pt;">Data Source=servername;Initial  Catalog=DBName;Provider=MSOLAP.2;<span style="color:blue;">&lt;/</span><span style="color:maroon;">value</span><span style="color:blue;">&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;/</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">connectionstring</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;/</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">connections</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;/</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">Configuration</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:'Courier New';color:blue;font-size:10pt;">&lt;/</span><span style="font-family:'Courier New';color:maroon;font-size:10pt;">Extension</span><span style="font-family:'Courier New';color:blue;font-size:10pt;">&gt;</span></p>
<p><em><span style="color:#000080;">There can be n number of connection defined, all wil be passed to CDE as a XML string.</span></em></p>
<p> Now when creating a Data Source in SSRS, this extension will be available to be selected as a type of connection:</p>
<p><a href="http://munishbansal.files.wordpress.com/2010/02/datasource_cde.jpg"><img class="alignleft size-full wp-image-396" title="DataSource_CDE" src="http://munishbansal.files.wordpress.com/2010/02/datasource_cde.jpg?w=500" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/388/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=388&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2010/02/18/extending-sql-server-reporting-services-2005-with-custom-data-extensions-ssrs/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/02/processflow.jpg" medium="image">
			<media:title type="html">ProcessFlow</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2010/02/datasource_cde.jpg" medium="image">
			<media:title type="html">DataSource_CDE</media:title>
		</media:content>
	</item>
		<item>
		<title>Importing data from Excel having Mixed Data Types in a column (SSIS)</title>
		<link>http://munishbansal.wordpress.com/2009/12/15/importing-data-from-excel-having-mixed-data-types-in-a-column-ssis/</link>
		<comments>http://munishbansal.wordpress.com/2009/12/15/importing-data-from-excel-having-mixed-data-types-in-a-column-ssis/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 08:55:55 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=385</guid>
		<description><![CDATA[When we use Excel (Excel source in case of excel 2003 &#38; OLEDB Source in case of excel 2007) as our data source in SSIS, we come across the fact that SSIS decides over the data type of a column of excel sheet based upon the contained metadata. Data source scans the metadata of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=385&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When we use Excel (Excel source in case of excel 2003 &amp; OLEDB Source in case of excel 2007) as our data source in SSIS, we come across the fact that SSIS decides over the data type of a column of excel sheet based upon the contained metadata. Data source scans the metadata of the excel sheet and determine the data type of columns.</p>
<p>But in this process, there are certain other parameters or settings which also play an important role in this and once decided; all other values with other data type in the same column are imported as NULL.</p>
<p>Example: If we have string and numbers values in the same column then either it will take it as string or number while configuring the excel data source. But again if it considers it as number then string values would be imported as NULL and in case no. of string values are more (in first 8 cells) then it would take string data type which would allow both the values to be imported.</p>
<p><span style="color:#ff0000;">And interesting point to be noted here is, even if we forcefully select ‘DT_WSTR’ (string) data type in the first case, then also it would behave the same.</span></p>
<p>There are the following settings which cause this unwanted output &amp; these are also the ways to configure them to have the correct results:</p>
<ul>
<li>Setting <strong>“<em>IMEX=1</em>”</strong> in the connection of the Excel sheet. This can be set in the connection string in case of Excel Source (Excel 2003) and can be set using ‘Extended Properties’ in case of OLE DB Source (Excel 2007). This setting tells that excel sheet is having mixed data types and thus import it as ‘Text’ values.</li>
</ul>
<p>Then we can forcefully select <strong>‘DT_NTEXT’</strong> data type in the data source. </p>
<ul>
<li>Registry setting <strong>“<em>TypeGuessRows=8</em>”</strong>: This setting/value tells the connection manager to consider the first 8 rows of a column and decide over its data type based upon the maximum no. of values type in those 8 values. So if we have first 5 rows/cells of a column of type string but rest of the 100 values are numbers then it would import all the numbers as NULL since data type in this would be String (DT_WSTR). This will be applied for all the packages i.e. on server level.</li>
</ul>
<p>So if we use a higher value for <span style="text-decoration:underline;">TypeGuessRows</span> (say 20) then it would take it as Integer.</p>
<p>But again here also it would import rest of the string values as NULL. </p>
<ul>
<li>Using ‘<strong>SELECT * FROM [SheetName$]</strong>’ query instead of direct table/sheet name. This will allow all type of values to get imported as ‘DT_WSTR’ which is quite acceptable because anyhow it’s getting all the values of a column. <strong>This is really a good option to select.</strong></li>
</ul>
<p><strong><em>Note:</em></strong><em> In all the cases where in we are getting string data (along with number data) be means of some or the other setting, we have to have String column in the destination.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/385/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=385&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2009/12/15/importing-data-from-excel-having-mixed-data-types-in-a-column-ssis/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>
	</item>
		<item>
		<title>How to read a Flat File with data delimited by any wild card character like ‘#’, ‘$’ (SSIS)</title>
		<link>http://munishbansal.wordpress.com/2009/08/12/reading-flat-file-data-delimited-by-any-wild-card-character-like-%e2%80%98%e2%80%99-%e2%80%98%e2%80%99-ssis/</link>
		<comments>http://munishbansal.wordpress.com/2009/08/12/reading-flat-file-data-delimited-by-any-wild-card-character-like-%e2%80%98%e2%80%99-%e2%80%98%e2%80%99-ssis/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 12:24:42 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=355</guid>
		<description><![CDATA[Requirement: Generally we deal with Flat Files which are comma (,) separated i.e. CSV files. And in SSIS by making use of ‘Flat File Source’ component we can read them very easily. These files can contain results/data from various sources like IBM, Mainframe, SAP etc. They may also be manually created or generated through some custom [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=355&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration:underline;"><span style="color:#993300;">Requirement:</span></span></strong></p>
<p>Generally we deal with Flat Files which are comma (,) separated i.e. CSV files. And in SSIS by making use of ‘Flat File Source’ component we can read them very easily. These files can contain results/data from various sources like IBM, Mainframe, SAP etc. They may also be manually created or generated through some custom applications. And thus due to some specific requirements or limitations; they may have data which is not comma (,), bar (|), semi colon (;) etc delimited. These are among the few possible options available in Flat File connection manager used while reading the Flat Files in SSIS.</p>
<p>Apart from that there may be the requirement of having data containing <strong>comma (,) </strong>in their values itself. And thus we cannot just replace all the delimiters like dollar or # with a comma to have a comma separated file.</p>
<p>So to make it possible &amp; read the records from a Flat File which can have any known separator for its column values, we need to do some kind of exercise explained below.</p>
<p><span style="color:#008000;"> <strong><span style="text-decoration:underline;">Solution:</span></strong></span></p>
<p>Since we don’t have any inbuilt option to select <strong>‘#’</strong> or <strong>‘$’</strong> etc as a delimiter for Flat File in connection manager, we would take the whole line/record into one column and then would split out all the values as per the present delimiter, using a Script Component.</p>
<p><span style="text-decoration:underline;"><span style="color:#000000;">Let’s take an example:</span></span></p>
<p>We have a .txt (Flat) file (say <strong><em>InputFile.txt</em></strong>) with three columns <strong>A, B and C</strong>. These headers are comma separated but the values under these columns are <strong>‘#’</strong> delimited.</p>
<p>Data into the file:</p>
<p><strong>A,B,C</strong></p>
<p><strong>100#200#300</strong></p>
<p><strong>500#600#700</strong></p>
<p><strong> </strong><strong><span style="text-decoration:underline;"><span style="color:#000080;">Steps for the SSIS Package:</span></span></strong></p>
<ol>
<li>Take a Data Flow Task (DFT).</li>
<li>On the data flow tab, Drag one ‘Flat File Source’, edit it and click on ‘<strong>Flat File Connection Manager -&gt; New</strong>’.</li>
</ol>
<ul>
<li>Name it as ‘<strong>SourceFileConnectionManager</strong>’.</li>
<li>Select the ‘<strong>Inputfile.txt</strong>’ in the File Name column by browsing the file.</li>
<li>Select Format as ‘<strong>delimited</strong>’.</li>
<li>Select ‘Header row delimiter’ as ‘<strong>Comma {,}’.</strong></li>
<li>Select the check box for ‘Column names in the first row’.</li>
</ul>
<p><img class="alignleft size-medium wp-image-356" title="1" src="http://munishbansal.files.wordpress.com/2009/08/1.jpg?w=392&#038;h=300" alt="1" width="392" height="300" /></p>
<p>   </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>  </p>
<p> </p>
<ul>
<li>Go to <strong>Column </strong>tab of this connection manager.</li>
<li>Select ‘<strong>{CR} {LF}’ </strong>as Row delimiter.</li>
</ul>
<p>Screen would look like as:</p>
<p><img class="alignleft size-full wp-image-357" title="2" src="http://munishbansal.files.wordpress.com/2009/08/2.jpg?w=500" alt="2"   /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p> </p>
<p>  </p>
<p><strong>As you can see all the data is now coming into a single column named ‘A,B,C’.</strong><strong> </strong></p>
<ul>
<li>Click <strong>OK</strong>.</li>
<li>Go to ‘Columns’ tab of the Flat File Source.</li>
<li>Rename the Output column as ‘<strong>A</strong>’.</li>
</ul>
<p><img class="alignleft size-full wp-image-358" title="3" src="http://munishbansal.files.wordpress.com/2009/08/3.jpg?w=500" alt="3"   /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<ul>
<li>Click <strong>Ok</strong>.</li>
</ul>
<p> 3. Drag a <strong>Script Component </strong>&amp; select to use it as a <strong>Transformation</strong> while adding it.</p>
<ul>
<li>Point the output of Flat File Source to this script component.</li>
<li>Edit its properties and select “<strong>A</strong>” as an input column there.</li>
<li>Go to ‘<strong>Input and Output’</strong> tab and add three output columns (col1, col2 &amp; col3) to the existing output ‘Output 0’. Select ‘four byte signed integer’ as their data type.</li>
</ul>
<p><img class="alignleft size-full wp-image-359" title="4" src="http://munishbansal.files.wordpress.com/2009/08/4.jpg?w=500" alt="4"   /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<ul>
<li>Modify the ‘<strong>SyncronizeInputId</strong>’ of Output0 to <strong>0</strong>. This is to make the script component asyncronized.</li>
</ul>
<p><img class="alignleft size-full wp-image-361" title="5" src="http://munishbansal.files.wordpress.com/2009/08/51.jpg?w=500" alt="5"   /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<ul>
<li>Go to ‘<strong>Script’</strong> tab and click on ‘Script Designer..’ to edit the script (VB.Net).</li>
<li>Select ‘Pre Compile’ as False.</li>
<li>Write the following script in the ‘<strong>Input0_ProcessInputRow</strong>’ event handler:</li>
</ul>
<p>         <span style="color:#ff00ff;">Dim values() As String</span></p>
<p><span style="color:#ff00ff;">        values = Row.A.Split(&#8220;#&#8221;.ToCharArray)</span></p>
<p><span style="color:#ff00ff;">         Output0Buffer.AddRow()</span></p>
<p><span style="color:#ff00ff;">        Output0Buffer.Col1 = Convert.ToInt32(values(0))</span></p>
<p><span style="color:#ff00ff;">        Output0Buffer.Col2 = Convert.ToInt32(values(1))</span></p>
<p><span style="color:#ff00ff;">        Output0Buffer.Col3 = Convert.ToInt32(values(2)) </span></p>
<ul>
<li>Close this and Click Ok.</li>
</ul>
<ol>
<li>Take one Flat File Destination and with the following shown setting configure its connection manager (<strong>DestinationFlatFileConnection</strong>).</li>
</ol>
<p><img class="alignleft size-full wp-image-362" title="6" src="http://munishbansal.files.wordpress.com/2009/08/6.jpg?w=500" alt="6"   /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><img class="alignleft size-full wp-image-363" title="7" src="http://munishbansal.files.wordpress.com/2009/08/7.jpg?w=500" alt="7"   /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<ul>
<li>Go to Advanced tab and modify the name of the columns from col1, col2 &amp; col3 to A, B &amp; C.</li>
<li>Go to the ‘<strong>Mappings’ </strong>tab of the flat File Destination and do the below shown column mappings:</li>
</ul>
<p><strong><img class="alignleft size-full wp-image-364" title="8" src="http://munishbansal.files.wordpress.com/2009/08/8.jpg?w=500" alt="8"   /></strong></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><strong>Now execute the package to have the following output in the ‘OutputFile.txt’ file.</strong></p>
<p><strong> </strong><strong>A,B,C</strong></p>
<p><strong>100,200,300</strong></p>
<p><strong>500,600,700</strong></p>
<p><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/355/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=355&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2009/08/12/reading-flat-file-data-delimited-by-any-wild-card-character-like-%e2%80%98%e2%80%99-%e2%80%98%e2%80%99-ssis/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/08/1.jpg?w=293" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/08/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/08/3.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/08/4.jpg" medium="image">
			<media:title type="html">4</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/08/51.jpg" medium="image">
			<media:title type="html">5</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/08/6.jpg" medium="image">
			<media:title type="html">6</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/08/7.jpg" medium="image">
			<media:title type="html">7</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/08/8.jpg" medium="image">
			<media:title type="html">8</media:title>
		</media:content>
	</item>
		<item>
		<title>Multi-language reports in SSRS (SQL Server Reporting Services)</title>
		<link>http://munishbansal.wordpress.com/2009/07/13/multi-language-reports-in-ssrs-sql-server-reporting-services/</link>
		<comments>http://munishbansal.wordpress.com/2009/07/13/multi-language-reports-in-ssrs-sql-server-reporting-services/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 10:56:11 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=349</guid>
		<description><![CDATA[Introduction In this world of globalization, everyone wants to have projects, reports etc being accessed by users across countries/cultures around the world. And thus one needs to support SSRS reports in multiple languages. Different-2 applications provide multi-lingual support in different-2 manners. Though, SSRS does not have inbuilt support for this, we can achieve it using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=349&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration:underline;"><strong><span style="color:#993300;">Introduction</span></strong></span></p>
<p>In this world of globalization, everyone wants to have projects, reports etc being accessed by users across countries/cultures around the world. And thus one needs to support SSRS reports in multiple languages.<br />
Different-2 applications provide multi-lingual support in different-2 manners. Though, SSRS does not have inbuilt support for this, we can achieve it using some code based technique.</p>
<p><span style="color:#993300;"><span style="text-decoration:underline;"><strong>Background</strong></span></span></p>
<p>Since, in general report contains numeric data which are to be analyzed based upon some textual headers/groups. So to actually say that a report has multi-lingual support, all that textual information should be dynamically changing as per the culture/language of end user.<br />
And since these fields basically are the labels/textboxes displaying textual information, we actually have to manage these labels/textboxes for multi-language support.<br />
Also we must have some mechanism by which we can detect the language/UI culture of end user and can present the page/report in an acceptable format.</p>
<p><span style="color:#993300;"><span style="text-decoration:underline;"><strong>Solution:</strong></span></span></p>
<p>In any way of its implementation, the resource information as what should be displayed in what language /culture, it has to be stored somewhere. This can be maintained in database or in a resource file etc. The structure of the resource storage table would be like:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="213" valign="top"><strong>Field Name</strong></td>
<td width="213" valign="top"><strong>Value</strong></td>
<td width="213" valign="top"><strong>Language</strong></td>
</tr>
<tr>
<td width="213" valign="top">Column1</td>
<td width="213" valign="top">Total Amount</td>
<td width="213" valign="top">En-US</td>
</tr>
<tr>
<td width="213" valign="top">Column1</td>
<td width="213" valign="top">Somme totale</td>
<td width="213" valign="top">French</td>
</tr>
</tbody>
</table>
<p>Now while displaying this column1 on the report, rather than hard coding its value, at runtime we have to detect the language of interest &amp; display the corresponding value. We can make use of the global variable of SSRS report <strong>‘User!Language’</strong> to get the current language been set in the client’s browser and then pass it to the data table.<br />
This can be done either by using a custom code (DLL/Assembly) in which we can have a function and this function will return the related value of fields.</p>
<p>Function: GetValue(fieldname, language)</p>
<p>Or we can use dynamic query &amp; directly make join to the resource table in our main data set for all the required fields. In this query we can then pass the language retuned by User!Language.</p>
<p><strong><span style="text-decoration:underline;">Steps:</span></strong><br />
1. Create a hidden parameter (CurrentLanguage) of type string.</p>
<p><img class="alignleft size-full wp-image-351" title="Lang_Param" src="http://munishbansal.files.wordpress.com/2009/07/lang_param1.jpg?w=500" alt="Lang_Param"   /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> 2. Use expression to assign a <strong>non-queried</strong> default value to this parameter as <strong>=User!Language</strong></p>
<p>3. Use dynamic query for the main data set as:</p>
<p>  <span style="color:#0000ff;">SELECT </span>ColumnName, measure1, measure2</p>
<p><span style="color:#0000ff;">FROM</span> MainTable MT JOIN resourceTable RT</p>
<p><span style="color:#0000ff;">ON</span> MT.FieldName = RT.ColumnName (<em>say ColumnName = Column1</em>)</p>
<p>AND RT.<span style="color:#0000ff;">Language</span> = @CurrentLanguage</p>
<p> </p>
<p>Now at runtime @CurrentLanguage will get the language of the client &amp; display the lables &amp; all in the correct language.</p>
<p> <span> </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/349/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=349&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2009/07/13/multi-language-reports-in-ssrs-sql-server-reporting-services/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/07/lang_param1.jpg" medium="image">
			<media:title type="html">Lang_Param</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating &amp; Using a Package Template (SQL Server Integration Services)</title>
		<link>http://munishbansal.wordpress.com/2009/06/30/creating-using-a-package-template-sql-server-integration-services/</link>
		<comments>http://munishbansal.wordpress.com/2009/06/30/creating-using-a-package-template-sql-server-integration-services/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 09:15:47 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=339</guid>
		<description><![CDATA[When we create an Integration Services solution, a package (package.dtsx) gets added to the solution automatically. This package uses the default package template, which is empty with no control flow task. Also when we add a new package (SSIS Packages folder) or add a new item &#38; select new package, a package with the default [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=339&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When we create an Integration Services solution, a package (package.dtsx) gets added to the solution automatically. This package uses the default package template, which is empty with no control flow task. Also when we add a new package (SSIS Packages folder) or add a new item &amp; select new package, a package with the default template gets added.</p>
<p>Now sometimes like in a big project, we may need to have reusable package tasks, connection managers etc and want to use them as a template for all the newly added packages. This may be required to have the pre &amp; post execution tasks like making entry in the transaction log at the beginning &amp; at the end of the package to impose consistency across packages. So in this case we would want to have a template package which should get added when we add a new package and which we can modify or add other tasks to as per the requirements.</p>
<p><span style="text-decoration:underline;"><span style="color:#0000ff;"><strong>Save &amp; Use a package as a package template:</strong></span></span></p>
<p>As stated above, we can use custom packages as templates in SSIS. There are few steps to be followed to save &amp; then use a package as a template.</p>
<ol>
<li>Create a package (<strong>MyPackagetemplate.dtsx</strong>) to be used as a template.</li>
<li>Copy this package to the DataTransformationItems folder residing at the location:</li>
</ol>
<p><span style="color:#ff6600;"><strong>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\ProjectItems\DataTransformationProject </strong><strong>\DataTransformationItems</strong></span></p>
<p><strong>      </strong>3.   <strong>Now while adding a new item to the integration services solution as shown below, the copied package will be available as a template in the templates pane:</strong></p>
<div id="attachment_340" class="wp-caption alignleft" style="width: 300px"><img class="size-full wp-image-340" title="1" src="http://munishbansal.files.wordpress.com/2009/06/1.jpg?w=500" alt="Add Template"   /><p class="wp-caption-text">Add Template</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div class="mceTemp">
<dl class="wp-caption alignleft">
<dt class="wp-caption-dt"><img class="size-full wp-image-341" title="2" src="http://munishbansal.files.wordpress.com/2009/06/2.jpg?w=500&#038;h=303" alt="Select Template" width="500" height="303" /></dt>
<dd class="wp-caption-dd">Select Template</dd>
</dl>
<p>And doing so, the newly added package will be added with all the tasks/transformations etc existing in the template package. And thus we need not to worry about the location of the reusable package while adding as it is always available as a template.</p>
<p><span style="text-decoration:underline;"><span style="color:#008000;">Point to be specified:</span></span></p>
<p>When we add an existing template or package, the package ID of the newly added package would remain same as that of the template package. This might be an issue if we are referring them in the log/error (sysdtslog90) tables. But we can change the Package ID by selecting ‘Generate New ID’ option as shown below.</p></div>
<div class="mceTemp"><img class="alignleft size-full wp-image-342" title="3" src="http://munishbansal.files.wordpress.com/2009/06/3.jpg?w=500" alt="3"   /></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/339/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=339&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2009/06/30/creating-using-a-package-template-sql-server-integration-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/06/1.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/06/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/06/3.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic columns mapping – Script Component as Destination (SSIS)</title>
		<link>http://munishbansal.wordpress.com/2009/06/09/dynamic-columns-mapping-%e2%80%93-script-component-as-destination-ssis/</link>
		<comments>http://munishbansal.wordpress.com/2009/06/09/dynamic-columns-mapping-%e2%80%93-script-component-as-destination-ssis/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 12:15:47 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=329</guid>
		<description><![CDATA[Requirement: In Data Flow task of SSIS, we have to define a Data Source as well as a destination to extract &#38; load the data respectively. And as per the functionality of data flow task (DFT), metadata of the source fields has to be defined at the design time. That’s the input columns from the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=329&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration:underline;"><span style="color:#800000;">Requirement:</span></span></strong></p>
<p>In Data Flow task of SSIS, we have to define a Data Source as well as a destination to extract &amp; load the data respectively. And as per the functionality of data flow task (DFT), metadata of the source fields has to be defined at the design time. That’s the input columns from the source must be mapped to the destination columns and for that we must know the schema of the input as well as the destination/output columns.</p>
<p>But in many business scenarios we come across the requirement where at runtime only we come to know about the structure of the input columns and thus at runtime only we have to decide for the destination columns, this is called dynamic mapping.</p>
<p><strong><span style="text-decoration:underline;"><span style="color:#008000;">Solution:</span></span></strong></p>
<p>This type of dynamic mapping for source to destination can be achieved using script component. This script component can be used in three ways in data flow task:</p>
<ol>
<li>As a Transformation,</li>
<li>As a Data Source</li>
<li>As a Destination</li>
</ol>
<p>When we drag &amp; drop the script component from tool box, a dialog box will appear to choose the required type.</p>
<div class="mceTemp">
<div id="attachment_337" class="wp-caption alignleft" style="width: 385px"><img class="size-full wp-image-337" title="Script_Component_Type" src="http://munishbansal.files.wordpress.com/2009/06/script_component_type1.jpg?w=500" alt="Script_Component_Type"   /><p class="wp-caption-text">Script_Component_Type</p></div>
</div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>1.  <span style="text-decoration:underline;">Transformation: </span>Script component can be used to do some transformations on the input data, processing each &amp; every row one by one. We can write custom code/script in it to make the required operations on the data. In this case total number of output columns would be same as that of input columns.</p>
<p>2.  <span style="text-decoration:underline;">Source: </span>If we select script component to be used as a Data Source, we can configure the component to generate the required number of rows as the output. In this case we can add as many columns we want in the output of the script component and then at runtime we can write code/script to add the rows in the output. We can also have multiple asynchronous outputs with different-2 names which can be loaded to different-2 destinations.</p>
<p>3.  <span style="text-decoration:underline;">Destination: </span>Sometimes we don’t want to dump/load the input data directly to the destination like OLEDB destination or Flat file destination; rather we want to decide for the number of columns/rows somewhere before actually loading the data. Here we can choose script component as a destination.</p>
<p>Script component should be used as a source, in case we are sure about the schema/columns of the input records. But in the component’s script editor we can process the data &amp; generate the output rows based upon certain conditions.  But here also we have to map the output of this component to the destination columns at design time only.</p>
<p>Now in case; we want to have dynamic mapping at runtime, we can configure Script component as a Destination. In this mode of component we can look at the input data &amp; decide about the structure of the fields to be loaded into the final destination, based upon certain conditions which can be stored in database or variables.</p>
<p><strong><span style="text-decoration:underline;"><span style="color:#0000ff;">Configuring Script Component as a Destination</span></span></strong></p>
<p><strong><span style="text-decoration:underline;">Adding Connection Managers:</span></strong> Since in the script component itself, we are going to load data into the final destination, we need the connection manager(s) to connect to the final destination e.g. Flat File connection manager, OLE DB connection manager etc. On <strong>Connection Managers </strong>page of the Script Component Editor, we can add the already created connection manager or also can add new connection managers. All the added connection managers would be available in the script via Me.Connections. connectionname (vb.net) &amp; this.Connections.connectionname (C#).</p>
<p><strong><span style="text-decoration:underline;">Input/ Output columns and Variables:</span></strong><span style="text-decoration:underline;"> </span>We can configure the input columns, output columns as well as variables as is done in the normal script task or component.</p>
<p><strong><span style="text-decoration:underline;">Scripting the Destination Component</span></strong><strong>: </strong>Its main configuration is the custom script (vb.net or C#) which is used to process the input data, decide over the number/ type of destination columns and then load them into the final destination.</p>
<p>There are many functions/subroutines which we can override in the script to acquire the added connection managers, process the input data, form the query at runtime &amp; load the data into the destination etc.</p>
<p><span style="text-decoration:underline;">Example:</span> Let’s take an example in which we add one <strong>ADO.Net</strong> connection manager ‘<strong>myConnection</strong>’ to execute a query at the SQL server destination.</p>
<p><strong><em>Note:</em></strong><em> Here we will connect to SQL Server via a managed connection manager (ADO.Net) because AcquireConnections function works for these only. Otherwise we’ll have to create connection in the script only; using the connection string of the defined connection manager.</em></p>
<p><span style="color:#0000ff;">Imports</span> System.Data.SqlClient</p>
<p><span style="color:#0000ff;">Public Class</span> ScriptMain</p>
<p>    <span style="color:#0000ff;">Inherits</span> UserComponent</p>
<p><span style="color:#0000ff;">Dim</span> conMgr <span style="color:#0000ff;">As</span> IDTSConnectionManager100</p>
<p>    <span style="color:#0000ff;">Dim</span> sqlConn <span style="color:#0000ff;">As</span> SqlConnection</p>
<p>    <span style="color:#0000ff;">Dim</span> sqlCmd <span style="color:#0000ff;">As</span> SqlCommand</p>
<p> <span style="color:#0000ff;">Public</span> <span style="color:#0000ff;">Overrides Sub</span> AcquireConnections(<span style="color:#0000ff;">ByVal</span> Transaction <span style="color:#0000ff;">As</span> Object)</p>
<p>  conMgr = <span style="color:#0000ff;">Me</span>.Connections.MyConnection</p>
<p>  sqlConn = CType(conMgr.AcquireConnection(<span style="color:#0000ff;">Nothing</span>), SqlConnection)</p>
<p>     <span style="color:#0000ff;">End Sub</span></p>
<p><span style="color:#0000ff;">     Public Overrides Sub</span> PreExecute()</p>
<p>         sqlCmd = <span style="color:#0000ff;">New</span> SqlCommand(&#8220;<span style="color:#800000;">INSERT INTO MyTable(Col1, Col2)</span> &#8221; &amp; _</p>
<p>            &#8220;<span style="color:#800000;">VALUES(@Value1, @Value2)</span>&#8220;, sqlConn)</p>
<p>        sqlParam = <span style="color:#0000ff;">New</span> SqlParameter(&#8220;<span style="color:#800000;">@Value1</span>&#8220;, SqlDbType.Int)</p>
<p>        sqlCmd.Parameters.Add(sqlParam)</p>
<p>        sqlParam = <span style="color:#800000;">New</span> SqlParameter(&#8220;<span style="color:#800000;">@Value2</span>&#8220;, SqlDbType.Int)</p>
<p>        sqlCmd.Parameters.Add(sqlParam)</p>
<p>   <span style="color:#0000ff;">  End Sub</span></p>
<p>     <span style="color:#0000ff;">Public Overrides Sub</span> MyAddressInput_ProcessInputRow(<span style="color:#0000ff;">ByVal</span> Row <span style="color:#0000ff;">As</span> MyAddressInputBuffer)</p>
<p>        With sqlCmd</p>
<p>            .Parameters(&#8220;<span style="color:#800000;">@Value1</span>&#8220;).Value = Row.ID</p>
<p>            .Parameters(&#8220;<span style="color:#800000;">@Value2</span>&#8220;).Value = Row.Count</p>
<p>            .ExecuteNonQuery()</p>
<p>        <span style="color:#0000ff;">End With</span></p>
<p><span style="color:#0000ff;">    End Sub</span></p>
<p>     <span style="color:#0000ff;">Public Overrides Sub </span>ReleaseConnections()</p>
<p>         conMgr.ReleaseConnection(sqlConn)</p>
<p>     <span style="color:#0000ff;">End Sub</span></p>
<p><span style="color:#0000ff;"> End Class</span></p>
<p> Thus we can process the input columns, make connections and based upon required conditions; we can build our own queries to dynamically map them to the destination. In the similar way we can write to Flat file destination as well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/329/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=329&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2009/06/09/dynamic-columns-mapping-%e2%80%93-script-component-as-destination-ssis/feed/</wfw:commentRss>
		<slash:comments>126</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>

		<media:content url="http://munishbansal.files.wordpress.com/2009/06/script_component_type1.jpg" medium="image">
			<media:title type="html">Script_Component_Type</media:title>
		</media:content>
	</item>
		<item>
		<title>Calculation tab not working – SQL Server 2005 Analysis Services</title>
		<link>http://munishbansal.wordpress.com/2009/05/28/calculation-tab-not-working-%e2%80%93-sql-server-2005-analysis-services/</link>
		<comments>http://munishbansal.wordpress.com/2009/05/28/calculation-tab-not-working-%e2%80%93-sql-server-2005-analysis-services/#comments</comments>
		<pubDate>Thu, 28 May 2009 10:26:03 +0000</pubDate>
		<dc:creator>Munish Bansal</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSAS]]></category>

		<guid isPermaLink="false">http://munishbansal.wordpress.com/?p=326</guid>
		<description><![CDATA[Problem/Bug: In Business Intelligence Development Studio for SQL Server 2005 analysis services, when we click on ‘Calculation’ Tab to define some calculated measures &#38; all, we can get the following error: ‘Unexpected error occurred: &#8216;Error in application.&#8217; Also having this error visual studio IDE will crash &#38; will be closed automatically. This issue may not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=326&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration:underline;"><span style="color:#ff0000;">Problem/Bug:</span></span></strong></p>
<p>In Business Intelligence Development Studio for SQL Server 2005 analysis services, when we click on ‘Calculation’ Tab to define some calculated measures &amp; all, we can get the following error:</p>
<p><strong><span style="color:#800000;">‘Unexpected error occurred: &#8216;Error in application.&#8217;</span></strong></p>
<p>Also having this error visual studio IDE will crash &amp; will be closed automatically.</p>
<p>This issue may not get resolved by applying SP2 or other hot fixes. And you may also not find this error logged into the event viewer.</p>
<p><strong><span style="text-decoration:underline;"><span style="color:#333399;">Cause:</span></span></strong></p>
<p>This problem occurs due to the compatibility issue i.e. version difference between the binaries/ DLLs.</p>
<p>These DLLs are 1. <strong>Msmdlocal.dll</strong> &amp; 2. <strong>Msmgdsrv.dll</strong></p>
<p><strong><span style="text-decoration:underline;"><span style="color:#008000;">Solution:</span></span></strong></p>
<p>Version of the assemblies ‘msmdlocal.dll’ &amp; ’Msmgdsrv.dll’ must be the same of the ones installed into <strong>“%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\”</strong> and the ones installed into <strong>“%ProgramFiles%\Common Files\System\Ole DB”</strong> location.</p>
<p>If it is not same for any or both of these DLLs, then replace the ones in ‘<strong>PrivateAssemblies</strong>’ with the ones from ‘<strong>ole db’.</strong></p>
<p> Happy SSAS Cube Designing..!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/munishbansal.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/munishbansal.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/munishbansal.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/munishbansal.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/munishbansal.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/munishbansal.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/munishbansal.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/munishbansal.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/munishbansal.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/munishbansal.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/munishbansal.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/munishbansal.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/munishbansal.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/munishbansal.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=munishbansal.wordpress.com&amp;blog=3584872&amp;post=326&amp;subd=munishbansal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://munishbansal.wordpress.com/2009/05/28/calculation-tab-not-working-%e2%80%93-sql-server-2005-analysis-services/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9610c53f53507935a4222f232be9385b?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">munishbansal</media:title>
		</media:content>
	</item>
	</channel>
</rss>
