<?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>Kenzapedia</title>
	<atom:link href="http://kenzalee.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kenzalee.wordpress.com</link>
	<description>Blog anything, anywhere</description>
	<lastBuildDate>Sun, 24 Aug 2008 02:26:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kenzalee.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Kenzapedia</title>
		<link>http://kenzalee.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kenzalee.wordpress.com/osd.xml" title="Kenzapedia" />
	<atom:link rel='hub' href='http://kenzalee.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to use Custom Assemblies in SQL Server Reporting Services (SSRS) 2005</title>
		<link>http://kenzalee.wordpress.com/2008/07/29/custom_asssemblies_ssrs/</link>
		<comments>http://kenzalee.wordpress.com/2008/07/29/custom_asssemblies_ssrs/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 10:16:32 +0000</pubDate>
		<dc:creator>kenzalee</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kenzalee.wordpress.com/2008/07/29/testing-abc/</guid>
		<description><![CDATA[Hi All! This is my first ever semi-technical blog so enjoy In addition to giving you pointers and instructions on how to use custom assemblies in reporting services, the core of this blog is to purposely detail on how to enable your report to make use of custom assemblies that use webservices 1. Develop the custom assembly library The details from here on forth is related to developing a .Net 2.0 assembly that calls a web service to request data from a data repository. To use methods [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenzalee.wordpress.com&amp;blog=4357100&amp;post=4&amp;subd=kenzalee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi All! This is my first ever semi-technical blog so enjoy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In addition to giving you pointers and instructions on how to use custom assemblies in<br />
reporting services, the core of this blog is to purposely detail on how to enable your report to<br />
make use of custom assemblies that use webservices</p>
<h2>1. Develop the custom assembly library</h2>
<p>The details from here on forth is related to developing a .Net 2.0<br />
assembly that calls a web service to request data from a data<br />
repository.</p>
<p>To use methods from the web service inside your custom library all<br />
you have to do is find out the web service URL and add it as a web<br />
reference. You can then use it by fully qualifying it with a dot to<br />
bring up the list of assessable methods. Keep in mind that the<br />
namespace of the web service and the custom library must be the same<br />
for intelli-sense to work.</p>
<p>The custom library is created was signed for improved security<br />
however this is optional. You can sign the assembly in VS2005 by going<br />
to the Properties -&gt; Signing and checking on the “Sign the assembly’<br />
checkbox.</p>
<p><span style="text-decoration:underline;">Important</span><br />
Before calling the web service in your custom assembly, you must do a<br />
couple of things to give permission or Code Access Security (CAS)<br />
clearance to Reporting Services to call methods within the web service<br />
that requires access to protected resource (in my case, access to read<br />
from an external database). Before you continue I highly recommend that<br />
you read up on CAS at: <a href="http://msdn2.microsoft.com/en-us/library/aa902638.aspx">http://msdn2.microsoft.com/en-us/library/aa902638.aspx</a>.<br />
I never thought I’d say this but this is actually one of the few useful<br />
articles published by Microsoft. The following steps show you how to<br />
get security clearance.</p>
<p><strong>a.</strong> Insert the following statement just before the web service<br />
method call to protected resource. Without this you won’t get any data<br />
back.<span><br />
</span><span><span><br />
</span></span><span><span><span><span><span><span>System.Net.WebPermission p;<br />
p = new System.Net.WebPermission(System.Net.NetworkAccess.Connect, URL);<br />
p.Assert();<br />
</span></span></span></span></span></span><br />
Where “URL” is the web address of the web service.</p>
<p><strong>b.</strong> Insert the following statement to AssemblyInfo.cs file</p>
<p><span><span><span><span><span><span>using System.Security;</span></span></span></span></span></span></p>
<p><span>[assembly: AllowPartiallyTrustedCallers()]</span></p>
<p>The purpose of this is to enable un-trusted code (i.e. Reporting<br />
Services) call your trusted code (i.e. your digitally signed assembly)</p>
<h2>2. Deploy the custom assembly library</h2>
<p>Once the DLL file is created you need to move it to a location where<br />
Reporting services can recognize it as its own flesh and blood. There<br />
are two locations and the one you use will depend on whether you are<br />
deploying for Testing and Debugging or Production. The locations are:</p>
<p><span><strong>a.</strong> Testing and Debugging</span><span><br />
<span><span><span><span><span>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies</span></span></span></span></span></span></p>
<p><span><strong>b.</strong> Production</span><span><br />
<span><span><span><span><span>C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin</span></span></span></span></span></span></p>
<p><span style="text-decoration:underline;">Warning</span><br />
I do not recommend you use the &#8220;post build actions&#8221; property of your<br />
assembly project to specify the DLL<br />
output. Reason being is that reporting services keeps custom<br />
assemblies loaded while it is still opened therefore any updates to the assembly will require<br />
you to close VS. If you&#8217;re doing debugging and using the method I recommended in this blog,<br />
the post build action method will fail</p>
<p>Testing is applicable when you intend to run the report locally from<br />
SSRS Report Designer’s preview window &#8211; excluding the Debugging mode<br />
where you step through you custom library as you run the report. For<br />
the purpose of Testing you need not do anything more, you can proceed<br />
straight to referencing the assembly in your report.</p>
<p>Deploying for Production or Debugging requires a little more work.<br />
In this situation reporting services will need to provide proof to the<br />
Common Language Runtime (CLR) that it has permission to execute your<br />
custom assembly (<span><strong>in particular</strong> <strong>the webservice that accesses protected resource</strong></span>). This proof is stored in the CAS Policy configuration files – one for the Reporting Server and one for the Report Designer.</p>
<p><span style="text-decoration:underline;">Background on Debugging:</span><br />
When you run the report in debugging mode you’re actually telling the<br />
designer to simulate the CAS policy as if it were running on the<br />
server. The CAS policy file for the debugger is independent of the one<br />
for the server.</p>
<p>To use the custom assembly in your report you need to modify the<br />
appropriate policy configuration file to include the “Code Group”. The<br />
best way I found to generate the Code Group is to use “Mscorcfg.msc”<br />
(.Net Framework Configuration Tool assessable via the VS Command<br />
Prompt). The following screens are instructions on HOW-TO.</p>
<p><strong>a.</strong> Expand the Code Group Node under Machine and create a new code group</p>
<p><img class="alignnone size-medium wp-image-29" src="http://kenzalee.files.wordpress.com/2008/08/01.jpg?w=300&#038;h=281" alt="" width="300" height="281" /></p>
<p><strong>b.</strong> Give your group a name</p>
<p><img class="alignnone size-medium wp-image-30" src="http://kenzalee.files.wordpress.com/2008/08/011.jpg?w=300&#038;h=284" alt="" width="300" height="284" /></p>
<p><strong>c.</strong> Import your custom assembly – remember to select Strong Name as Condition type.</p>
<p><img class="alignnone size-medium wp-image-31" src="http://kenzalee.files.wordpress.com/2008/08/012.jpg?w=300&#038;h=284" alt="" width="300" height="284" /></p>
<p><strong>d.</strong> Grant Reporting Services full trust to the custom assembly</p>
<p><img class="alignnone size-medium wp-image-32" src="http://kenzalee.files.wordpress.com/2008/08/013.jpg?w=300&#038;h=284" alt="" width="300" height="284" /></p>
<p><strong>e.</strong> Open .NET security configuration file at:</p>
<p><span><span><span><span><span><span>C:\WINDOWS\Microsoft.NET\Framework\&lt;.Net version&gt;\CONFIG\security.config</span></span></span></span></span></span><br />
Where &#8220;.Net version&#8221; is the framework version currently installed and used on your system</p>
<p><strong>f.</strong> Do a search for the code group name you supplied earlier and copy everything between the Code Group tags. Example -</p>
<p><img class="alignnone size-medium wp-image-34" src="http://kenzalee.files.wordpress.com/2008/08/015.jpg?w=300&#038;h=245" alt="" width="300" height="245" /></p>
<p> </p>
<p><strong>g.</strong> Now that you have the code you’re ready to paste it into<br />
the Policy file. Like I mentioned earlier there are 2 policy files, one<br />
for the Reporting Server and one for the Report Designer.</p>
<p>For Debugging, add the Code Group to:<br />
<span><span><span><span><span><span>C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\rssrvpolicy.config</span></span></span></span></span></span></p>
<p>For Production, add the Code Group to:<br />
<span><span><span><span><span><span>C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\rssrvpolicy.config</span></span></span></span></span></span></p>
<p><strong>h.</strong> Once that’s done you’re pretty much ready to use the<br />
assembly in your report. The stuff you just created in .Net Framework<br />
2.0 Configuration can be deleted if need be as it does not impact on<br />
anything.</p>
<h2>3. Use the custom assembly library</h2>
<p>Now comes the easy part where you should be able to do blind-folded after what you’ve just been through.</p>
<p><strong>a.</strong> First you need add the assembly to your report reference list</p>
<p><img class="alignnone size-full wp-image-35" src="http://kenzalee.files.wordpress.com/2008/08/016.jpg?w=495" alt=""   /></p>
<p>The assembly name details may change each time you update your assembly which means you’ll have to delete and re-add it.</p>
<p>The Classes section is optional and depends on how you designed your<br />
class. If your class is static or contains static methods then you need<br />
not use it as there’s no need to create an instance of the class in<br />
order to use it. However, if it’s the opposite then you need to supply<br />
the class name and give it an instance name. The class name must be in<br />
the format of <em>namespace.classname</em></p>
<p><strong>b.</strong> Once you’ve added the reference you can call the methods by typing either one of the following.</p>
<p><span><span><span><span><span><span>=Namespace.Class.Method</span></span></span></span></span></span><br />
This is applicable if you’re calling a static member. Namespace, class and method is what’s unique to your assembly.</p>
<p><span><span><span><span><span><span>=Code.InstanceName.Method</span></span></span></span></span></span><br />
This is used when you’re calling a non-static method</p>
<h2>Reference</h2>
<p>Bryantlikes<br />
<a href="http://blogs.sqlxml.org/bryantlikes/pages/824.aspx">http://blogs.sqlxml.org/bryantlikes/pages/824.aspx</a></p>
<p>Thanks goes to Bryantlikes for writing the blog that got me started and thinking.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kenzalee.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kenzalee.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenzalee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenzalee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenzalee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenzalee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenzalee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenzalee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenzalee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenzalee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenzalee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenzalee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenzalee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenzalee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenzalee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenzalee.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenzalee.wordpress.com&amp;blog=4357100&amp;post=4&amp;subd=kenzalee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenzalee.wordpress.com/2008/07/29/custom_asssemblies_ssrs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9276ad3cf67c12e45155e29e3860af20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Kenza</media:title>
		</media:content>

		<media:content url="http://kenzalee.files.wordpress.com/2008/08/01.jpg?w=300" medium="image" />

		<media:content url="http://kenzalee.files.wordpress.com/2008/08/011.jpg?w=300" medium="image" />

		<media:content url="http://kenzalee.files.wordpress.com/2008/08/012.jpg?w=300" medium="image" />

		<media:content url="http://kenzalee.files.wordpress.com/2008/08/013.jpg?w=300" medium="image" />

		<media:content url="http://kenzalee.files.wordpress.com/2008/08/015.jpg?w=300" medium="image" />

		<media:content url="http://kenzalee.files.wordpress.com/2008/08/016.jpg" medium="image" />
	</item>
		<item>
		<title>How to Debug Custom Assemblies in SQL Server Reporting Services (SSRS) 2005</title>
		<link>http://kenzalee.wordpress.com/2008/07/29/debug_assemblies_ssrs/</link>
		<comments>http://kenzalee.wordpress.com/2008/07/29/debug_assemblies_ssrs/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 09:46:01 +0000</pubDate>
		<dc:creator>kenzalee</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The simplest way to step through an assembly in SSRS 2005 is to add the custom assembly solution to your current reporting project and specify which report you want to debug the assembly against. Pre-requisite: You must ensure that the DLL of your assembly is copied to reporting services private assembly location (see below) otherwise [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenzalee.wordpress.com&amp;blog=4357100&amp;post=1&amp;subd=kenzalee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The simplest way to step through an assembly in SSRS 2005 is to add the custom assembly solution to your current reporting project and specify which report you want to debug the assembly against.</p>
<p><span style="text-decoration:underline;">Pre-requisite:</span><br />
You must ensure that the DLL of your assembly is copied to reporting services private assembly location (see below) otherwise your report won’t recognize it.</p>
<p><span><span><span>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies</span></span></span></p>
<p>You need to do this at least once and anytime you update the assembly code. In the case of updates you need to close VS altogether before you can copy it to the directory. Reason being is because Reporting Services only loads assemblies once and keeps it in memory for improved performance.</p>
<p><strong>a.</strong> To add an existing assembly project to your reporting project just go File -&gt; Add -&gt; Existing Project.</p>
<p><img class="alignnone size-full wp-image-37" src="http://kenzalee.files.wordpress.com/2008/08/017.jpg?w=495" alt=""   /></p>
<p><strong>b.</strong> To specify the report you want to debug go Project -&gt; Properties</p>
<p><img class="alignnone size-medium wp-image-38" src="http://kenzalee.files.wordpress.com/2008/08/018.jpg?w=300&#038;h=160" alt="" width="300" height="160" /></p>
<p>That’s really all there is to it. You can step through your code by adding breakpoints to your custom source and hitting F5. The most common problem you’ll probably run into is you forget to update the DLL to reporting services private assembly location.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kenzalee.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kenzalee.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenzalee.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenzalee.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenzalee.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenzalee.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenzalee.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenzalee.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenzalee.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenzalee.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenzalee.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenzalee.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenzalee.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenzalee.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenzalee.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenzalee.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenzalee.wordpress.com&amp;blog=4357100&amp;post=1&amp;subd=kenzalee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenzalee.wordpress.com/2008/07/29/debug_assemblies_ssrs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9276ad3cf67c12e45155e29e3860af20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Kenza</media:title>
		</media:content>

		<media:content url="http://kenzalee.files.wordpress.com/2008/08/017.jpg" medium="image" />

		<media:content url="http://kenzalee.files.wordpress.com/2008/08/018.jpg?w=300" medium="image" />
	</item>
	</channel>
</rss>
