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

<channel>
	<title>Davy&#039;s Blog &#187; .Net</title>
	<atom:link href="http://blog.davyknuysen.be/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.davyknuysen.be</link>
	<description>My Blog on Microsoft BI</description>
	<lastBuildDate>Wed, 12 May 2010 11:11:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SQL Server Day 2009 videos now available on Chopsticks</title>
		<link>http://blog.davyknuysen.be/2009/12/16/sql-server-day-2009-videos-now-available-on-chopsticks/</link>
		<comments>http://blog.davyknuysen.be/2009/12/16/sql-server-day-2009-videos-now-available-on-chopsticks/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 10:10:05 +0000</pubDate>
		<dc:creator>Davy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Analysis Services]]></category>
		<category><![CDATA[BI]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Excel Services]]></category>
		<category><![CDATA[Integration Services]]></category>
		<category><![CDATA[MDX]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerPivot]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[SQL 2008 R2]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQLUG.BE]]></category>
		<category><![CDATA[Chopsticks]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://blog.davyknuysen.be/?p=165</guid>
		<description><![CDATA[Microsoft has made the sessions presented on SQL Server Day 2009 available on Chopsticks Opening Keynote by Wesley Backelant and Ritchie Houtmeyers Best Practices for SQL Server Consolidation by Tom Van Mulders Breaking the ETL world record with Integration Services by Henk van der Valk Designing Effective Aggregations in Analysyis Services 2008 by Chris Webb [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft has made the sessions presented on SQL Server Day 2009 available on Chopsticks</p>
<ul>
<li><a href="http://www.microsoft.com/belux/MSDN/nl/chopsticks/default.aspx?id=1504" target="_blank">Opening Keynote</a> by Wesley Backelant and Ritchie Houtmeyers</li>
<li><a href="http://www.microsoft.com/belux/TechNet/nl/chopsticks/default.aspx?id=1493" target="_blank">Best Practices for SQL Server Consolidation</a> by Tom Van Mulders</li>
<li><a href="http://www.microsoft.com/belux/TechNet/nl/chopsticks/default.aspx?id=1498" target="_blank">Breaking the ETL world record with Integration Services</a> by Henk van der Valk</li>
<li><a href="http://www.microsoft.com/belux/MSDN/nl/chopsticks/default.aspx?id=1499" target="_blank">Designing Effective Aggregations in Analysyis Services 2008</a> by Chris Webb</li>
<li><a href="http://www.microsoft.com/belux/MSDN/nl/chopsticks/default.aspx?id=1500" target="_blank">High availability for BI DWH</a> by Patrick Tack</li>
<li><a href="http://www.microsoft.com/belux/TechNet/nl/chopsticks/default.aspx?id=1501" target="_blank">How New.NET Development technologies could change the live of the SQL DBA guy/girl</a> by Gill Cleeren &amp; Kurt Claeys</li>
<li><a href="http://www.microsoft.com/belux/TechNet/nl/chopsticks/default.aspx?id=1502" target="_blank">Implementing best practices with Policy Based Management</a> by Nico Jacobs</li>
<li><a href="http://www.microsoft.com/belux/MSDN/nl/chopsticks/default.aspx?id=1503" target="_blank">Introducing to PowerPivot or How I Learned to Stop Worrying and Love Excel</a> by Chris Webb</li>
<li><a href="http://www.microsoft.com/belux/TechNet/nl/chopsticks/default.aspx?id=1505%20" target="_blank">Tracking Changes and Data movement in SQL Server 2008</a> by Dirk Gubbels</li>
<li><a href="http://www.microsoft.com/belux/TechNet/nl/chopsticks/default.aspx?id=1506%20" target="_self">Handling XML in SQL Server</a> by Nico Jacobs</li>
</ul>
<p>Have fun!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.davyknuysen.be/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.davyknuysen.be/2009/12/16/sql-server-day-2009-videos-now-available-on-chopsticks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Problem opening report solution: Project item &#8216;#itemn°#&#8217; does not represent a file.</title>
		<link>http://blog.davyknuysen.be/2007/04/25/problem-opening-report-solution-project-item-itemn%c2%b0-does-not-represent-a-file/</link>
		<comments>http://blog.davyknuysen.be/2007/04/25/problem-opening-report-solution-project-item-itemn%c2%b0-does-not-represent-a-file/#comments</comments>
		<pubDate>Wed, 25 Apr 2007 11:11:38 +0000</pubDate>
		<dc:creator>Davy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[BI]]></category>

		<guid isPermaLink="false">http://geekswithblogs.net/davyknuysen/archive/2007/04/25/111964.aspx</guid>
		<description><![CDATA[Today I had some problems with a report solution created in Visual Studio 2005: After I got the latest version out of SourceSafe, I could not open it anymore. The error message was &#8220;Project item &#8217;4294967294&#8242; does not represent a file.&#8221; Searching for this error on the internet I came to this solution: - Open [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had some problems with a report solution created in Visual Studio 2005:</p>
<p>After I got the latest version out of SourceSafe, I could not open it anymore. The error message was <strong><em>&#8220;Project item &#8217;4294967294&#8242; does not represent a file.&#8221; </em></strong></p>
<p>Searching for this error on the internet I came to this <strong>solution</strong>:</p>
<blockquote style="margin-right: 0px;" dir="ltr"><p><em><span style="color: #0000ff;">- Open the .rptproj file in notepad (or another text editor) and delete the line that begins with &#8220;&lt;State&gt;$base64$&#8221;<br />
- Open the solution<br />
- Delete the source control bindings<br />
- Add it to source control again</span></em></p>
<p><em><span style="color: #0000ff;">- Done!</span></em></p></blockquote>
<p><span style="color: #000000;"> </span></p>
<p><span style="color: #000000;">Davy Knuysen</span></p>
<p style="margin-right: 0px;" dir="ltr">
<p><a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=111964"><img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=111964" border="0" alt="" /></a></p>
<p>&lt;br /&gt; &lt;mce:script language=mce-&#8217;javascript1.1&#8242; mce_src=&#8221;http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;amp;PageID=31016&amp;amp;SiteID=1&#8243;&gt;&lt;/mce:script&gt;&lt;br /&gt; &lt;noscript&gt;&lt;a href=&#8221;http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016&#8243; mce_href=&#8221;http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016&#8243; target=&#8221;_blank&#8221;&gt;&lt;br /&gt; &lt;img src=&#8221;http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016&#8243; mce_src=&#8221;http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016&#8243; width=&#8221;1&#8243; height=&#8221;1&#8243; border=&#8221;0&#8243;  alt=&#8221;"&gt;&lt;/a&gt;&lt;br /&gt; &lt;/noscript&gt;&lt;br /&gt;<br />
<img src="http://geekswithblogs.net/davyknuysen/aggbug/111964.aspx" alt="" width="1" height="1" /></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.davyknuysen.be/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.davyknuysen.be/2007/04/25/problem-opening-report-solution-project-item-itemn%c2%b0-does-not-represent-a-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL Server Reporting Services: Create and Call a Custom Assembly</title>
		<link>http://blog.davyknuysen.be/2007/03/27/sql-server-reporting-services-create-and-call-a-custom-assembly/</link>
		<comments>http://blog.davyknuysen.be/2007/03/27/sql-server-reporting-services-create-and-call-a-custom-assembly/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 03:51:00 +0000</pubDate>
		<dc:creator>Davy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[BI]]></category>

		<guid isPermaLink="false">http://geekswithblogs.net/davyknuysen/archive/2007/03/26/109901.aspx</guid>
		<description><![CDATA[In one of my previous articles I explained how to use embedded code in SQL Server Reporting Services. The possibility to add embedded code to a report, is a very powerfull feature to add some custom functionality to your report. But sometimes it might be necessary to add some custom functionality that is too complicated [...]]]></description>
			<content:encoded><![CDATA[<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri">In one of my previous articles I explained how to use embedded code in SQL Server Reporting Services. The possibility to add embedded code to a report, is a very powerfull feature to add some custom functionality to your report.<br />
But sometimes it might be necessary to add some custom functionality that is too complicated for embedded code to handle efficiently, or you need to access the same function from multiple reports, or you would like to write you code in C#&#8230;<br />
In one of these cases you should develop a custom assembly to call from your report.<o:p></o:p></font></font></font></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri">Let’s start with a simple example and develop a function PercentageToColor() to return a color based on a numeric value representing a percentage.<o:p></o:p></font></font></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; color: blue; font-family: 'Courier New';">namespace</span><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"> MyAssembly<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000">{<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><span style=""><font color="#000000">    </font></span><span style="color: blue;">public</span><font color="#000000"> </font><span style="color: blue;">class</span><font color="#000000"> </font><span style="color: teal;">Colors<o:p></o:p></span></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">    </span>{<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><span style=""><font color="#000000">        </font></span><span style="color: blue;">public</span><font color="#000000"> </font><span style="color: blue;">string</span><font color="#000000"> PercentageToColor(</font><span style="color: blue;">double</span><font color="#000000"> percentage)<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">        </span>{<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><span style=""><font color="#000000">            </font></span><span style="color: blue;">string</span><font color="#000000"> returnValue = </font><span style="color: blue;">string</span><font color="#000000">.Empty;<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><o:p><font color="#000000"> </font></o:p></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><span style=""><font color="#000000">            </font></span><span style="color: blue;">if</span><font color="#000000"> (percentage &lt; 20)<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">            </span>{<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">                </span>returnValue = </font><span style="color: maroon;">&#8220;red&#8221;</span><font color="#000000">;<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">            </span>}<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><span style=""><font color="#000000">            </font></span><span style="color: blue;">else</span><font color="#000000"> </font><span style="color: blue;">if</span><font color="#000000"> (percentage &lt; 80)<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">            </span>{<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">                </span>returnValue = </font><span style="color: maroon;">&#8220;blue&#8221;</span><font color="#000000">;<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">            </span>}<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><span style=""><font color="#000000">            </font></span><span style="color: blue;">else<o:p></o:p></span></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">            </span>{<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">                </span>returnValue = </font><span style="color: maroon;">&#8220;green&#8221;</span><font color="#000000">;<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><font color="#000000"><span lang="EN-US" style="font-size: 10pt; font-family: 'Courier New';"><span style="">            </span></span><span style="font-size: 10pt; font-family: 'Courier New';">}<o:p></o:p></span></font></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span style="font-size: 10pt; font-family: 'Courier New';"><o:p><font color="#000000"> </font></o:p></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span style="font-size: 10pt; font-family: 'Courier New';"><span style=""><font color="#000000">            </font></span><span style="color: blue;">return</span><font color="#000000"> returnValue;<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">        </span>}<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 0pt; line-height: normal;" class="MsoNormal"><span style="font-size: 10pt; font-family: 'Courier New';"><font color="#000000"><span style="">    </span>}<o:p></o:p></font></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><font color="#000000"><span style="font-size: 10pt; line-height: 115%; font-family: 'Courier New';">}</span><span lang="EN-US" style=""><o:p></o:p></span></font></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri">Once you’ve compiled your class you need to copy the resulting assembly to the directory in which it is accessible from within your report:<o:p></o:p></font></font></font></span></p>
<p style="margin: 0cm 0cm 0pt 18pt; text-indent: -18pt;" class="MsoListParagraphCxSpFirst"><span lang="EN-US" style="color: rgb(0, 112, 192); font-family: Symbol;"><span style=""><font size="3">·</font><span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">         </span></span></span><span lang="EN-US" style=""><font size="3"><font face="Calibri"><font color="#000000">To use it in the report designer, you need to copy it to:<br />
<span style=""> </span></font><span style="color: rgb(0, 112, 192);">C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies<o:p></o:p></span></font></font></span></p>
<p style="margin: 0cm 0cm 10pt 18pt; text-indent: -18pt;" class="MsoListParagraphCxSpLast"><span lang="EN-US" style="color: rgb(0, 112, 192); font-family: Symbol;"><span style=""><font size="3">·</font><span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">         </span></span></span><span lang="EN-US" style=""><font size="3"><font face="Calibri"><font color="#000000">To make it available for reports that have been deployed to the report server, you need to copy it to:<br />
</font><span style="color: rgb(0, 112, 192);"><span style=""> </span>C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin</span></font></font></span></p>
<p style="margin: 0cm 0cm 10pt 18pt; text-indent: -18pt;" class="MsoListParagraphCxSpLast"><span lang="EN-US" style=""><font size="3"><font face="Calibri"><span style="color: rgb(0, 112, 192);"><o:p></o:p></span></font></font></span> </p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri"><img border="0" src="http://blog.n-technologies.be/content/binary/SSRSReferences.jpg" alt="" /></font></font></font></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri"></font></font></font></span> </p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri">Before you can access your custom assembly you have to reference the assembly: Open the report properties (Menu: <em style="">Report – Report Properties</em>) and select the References tab.<o:p></o:p></font></font></font></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span style=""><v:shapetype coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f" id="_x0000_t75"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></span><span lang="EN-US" style=""><o:p></o:p></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri">Browse to your assembly and define a Class Name and an Instance Name. (The Class Name and the Instance Name or only for non-static methods). Make sure to prefix your class name with the assembly name. <o:p></o:p></font></font></font></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri">Now you can call the methods in your assembly from your report, using an expression:<o:p></o:p></font></font></font></span></p>
<p style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt;" class="MsoListParagraphCxSpFirst"><span lang="EN-US" style="color: rgb(0, 112, 192); font-family: Symbol;"><span style=""><font size="3">·</font><span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">         </span></span></span><span lang="EN-US" style=""><font size="3"><font face="Calibri"><font color="#000000">To call a static method: </font><span style="color: rgb(0, 112, 192);">=&lt;AssemblyName&gt;.&lt;ClassName&gt;.&lt;StaticMethodName&gt;<o:p></o:p></span></font></font></span></p>
<p style="margin: 0cm 0cm 10pt 36pt; text-indent: -18pt;" class="MsoListParagraphCxSpLast"><span lang="EN-US" style="color: rgb(0, 112, 192); font-family: Symbol;"><span style=""><font size="3">·</font><span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">         </span></span></span><span lang="EN-US" style=""><font size="3"><font face="Calibri"><font color="#000000">To call an instance method: </font><span style="color: rgb(0, 112, 192);">=Code.&lt;InstanceName&gt;.&lt;PublicMethodName&gt;<o:p></o:p></span></font></font></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font face="Calibri"><font color="#000000">So in our example this would be: </font><span style="color: rgb(0, 112, 192);">=Code.TestColor.PercentageToColor(<em style="">Fields!Percentage.Value</em>)<o:p></o:p></span></font></font></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><o:p><font size="3" face="Calibri" color="#000000"> That&#8217;s it! You&#8217;ve just created and called a custom assembly from your report&#8230;</font></o:p></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><o:p><font size="3" face="Calibri" color="#000000"></font></o:p></span> </p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><o:p><font size="3" face="Calibri" color="#000000"> In one of my future articles I will explain how to pass parameters to the class constructor and I will also tell something about SSRS and .Net Permissions&#8230;</font></o:p></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><o:p><font size="3" face="Calibri" color="#000000"></font></o:p></span> </p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><o:p><font size="3" face="Calibri" color="#000000"> </font></o:p></span></p>
<p style="margin: 0cm 0cm 10pt;" class="MsoNormal"><span lang="EN-US" style=""><font size="3"><font color="#000000"><font face="Calibri">Davy Knuysen<o:p></o:p></font></font></font></span></p>
<p><a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&#038;u=109901"><img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&#038;u=109901" border="0"/></a></p>
<p><iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;Task=Get&amp;PageID=31016&amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No><br />
<script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;Task=Get&amp;Browser=NETSCAPE4&amp;NoCache=True&#038;PageID=31016&amp;SiteID=1"></script><br />
<noscript><a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;Task=Click&amp;Mode=HTML&amp;SiteID=1&amp;PageID=31016" target="_blank"><br />
<img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;Task=Get&amp;Mode=HTML&amp;SiteID=1&amp;PageID=31016" width="1" height="1" border="0"  alt=""></a><br />
</noscript><br />
</iframe><br />
<img src="http://geekswithblogs.net/davyknuysen/aggbug/109901.aspx" width="1" height="1" /></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.davyknuysen.be/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.davyknuysen.be/2007/03/27/sql-server-reporting-services-create-and-call-a-custom-assembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedded Code in SQL Server Reporting Services</title>
		<link>http://blog.davyknuysen.be/2007/01/10/embedded-code-in-sql-server-reporting-services/</link>
		<comments>http://blog.davyknuysen.be/2007/01/10/embedded-code-in-sql-server-reporting-services/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 06:08:00 +0000</pubDate>
		<dc:creator>Davy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQLServerPedia]]></category>
		<category><![CDATA[BI]]></category>

		<guid isPermaLink="false">http://geekswithblogs.net/davyknuysen/archive/2007/01/10/103210.aspx</guid>
		<description><![CDATA[Sometimes it might be necessary to use the same expression on different places throughout a report. You can of course just copy and paste the expression every time you need it, but if you&#8217;ll ever need to change this expression, you will have to change it for every field you’re using it for. Therefore it’s good [...]]]></description>
			<content:encoded><![CDATA[<p style="margin: 0cm 0cm 0pt;" class="MsoNormal">Sometimes it might be necessary to use the same expression on different places throughout a report. You can of course just copy and paste the expression every time you need it, but if you&#8217;ll ever need to change this expression, you will have to change it for every field you’re using it for. Therefore it’s good practice to write this expression just once and refer to it where necessary. This can be done by implementing embedded code, that can be entered through the report’s property dialog on the Code tab. </p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p> </o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p> </o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><em style="">(Click “Report”, “Report Properties” and select the Code tab)</em></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p> </o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p></o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p><img src="http://users.skynet.be/davyknuysen/images/reportsmenu.jpg" alt="" />                <img src="http://users.skynet.be/davyknuysen/images/embeddedcode.jpg" alt="" /> </o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"> </p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal">Assume you have some calculated percentage fields and you need to set the background color depending on it’s value:</p>
<p style="margin: 0cm 0cm 0pt 18pt; text-indent: -18pt;" class="MsoNormal"><span style="">-<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">          </span></span>when the value is less then 20% : background must be red</p>
<p style="margin: 0cm 0cm 0pt 18pt; text-indent: -18pt;" class="MsoNormal"><span style="">-<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">          </span></span>when the value is between 20 and 80%: <span style=""> </span>background must be orange</p>
<p style="margin: 0cm 0cm 0pt 18pt; text-indent: -18pt;" class="MsoNormal"><span style="">-<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">          </span></span>when the value is greater then 80%: background must be green</p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p> </o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal">Add the following function to the custom code textbox:<span style="color: blue;"><o:p></o:p></span></p>
<div style="border: 1pt solid windowtext; padding: 1pt 4pt;">
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;">Function GetColor(ByVal percentage As Double) As String<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">        </span>Dim returnValue As String<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><o:p> </o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">        </span>Select Case percentage<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">            </span>Case Is &lt; 20<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">                </span>returnValue = &#8220;red&#8221;<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">            </span>Case Is &lt; 80<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">                </span>returnValue = &#8220;orange&#8221;<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">            </span>Case Is &gt; 80<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">                </span>returnValue = &#8220;green&#8221;<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">        </span>End Select<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><o:p> </o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;"><span style="">        </span>Return returnValue<o:p></o:p></span></p>
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;">End Function<o:p></o:p></span></p>
</div>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="color: blue;"><o:p> </o:p></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal">Now you can access this function as a member of the class called “Code”:</p>
<div style="border: 1pt solid windowtext; padding: 1pt 4pt;">
<p style="border: medium none ; margin: 0cm 0cm 0pt; padding: 0cm;" class="MsoNormal"><span style="color: blue;">=Code.GetColor(Fields!CalculatedPercentage.Value)<o:p></o:p></span></p>
</div>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p> </o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p>The Embedded Code Window is a very handy tool to quickly add some easy functions to your report.</o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal">But at this time, Embedded Code only supports Visual Basic and the Embedded Code Window is nothing more then a large textbox, without Intellisense or any debugging info. </p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal">Embedded Code can also only be reached from within the same report. <o:p> </o:p></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p></o:p>Therefore if you want multiple reports to access the same code, or you would like to write your code in C#, <span style=""> </span>or do some really advanced things, you should consider accessing a .NET assembly from the embedded code, which I will explain in one of my future articles…</p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><o:p> </o:p></p>
<p><a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&#038;u=103210"><img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&#038;u=103210" border="0"/></a></p>
<p><iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;Task=Get&amp;PageID=31016&amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No><br />
<script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;Task=Get&amp;Browser=NETSCAPE4&amp;NoCache=True&#038;PageID=31016&amp;SiteID=1"></script><br />
<noscript><a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;Task=Click&amp;Mode=HTML&amp;SiteID=1&amp;PageID=31016" target="_blank"><br />
<img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;Task=Get&amp;Mode=HTML&amp;SiteID=1&amp;PageID=31016" width="1" height="1" border="0"  alt=""></a><br />
</noscript><br />
</iframe><br />
<img src="http://geekswithblogs.net/davyknuysen/aggbug/103210.aspx" width="1" height="1" /></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.davyknuysen.be/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.davyknuysen.be/2007/01/10/embedded-code-in-sql-server-reporting-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
