Using custom Assemblies with SQL Server Reporting Services.

In almost every Reporting Services class I teach, I get basically same questions. One of the most popular questions is how do I call a method in a custom assembly from my report.  Here are step By step, instructions to do this.

 

1.       Using Visual Studio Create a new Class Library(VB or C#) I am going to name my Project SSRSAssembly

2.       Rename your Class1.VB or Class1.CS to ComplexCalculations, presumably you would have your re-usable methods in this class

3.       For next step, please use your imagination, pretend the following function has a few lines of code with loops possible calls to other assemblies and does some complex calculations (instead of just returning the square value of the parameter being sent to it.

(a)    Add the following Method to your Class

VB

Public Function SquareMe(ByVal i As Integer) As Integer

        Return i ^ 2

End Function

C#

public int SquareMe(int i)

{

    return Math.Pow(i, 2);

}

    

4.       Build Your project .

5.       Open your Report project.

(1)    Access your report properties from the Reports menu option

(2)    Click on the reference tab and add a reference to your assembly by browsing to it.

(3)    Define the class name ( in my example I called my class  ComplexCalculations)

(4)    Provide an Instance name.

6.       In a textbox within your dataregion where you want to display the result of your call, enter:

=Code.MyInstance.SquareMe(Fields!SickLeaveHours.Value)

7.       Copy your Custom dll to Report Server bin folder (default location is C:\Program Files\Microsoft SQL Server\MSSQL.x\Reporting Services\ReportServer\bin)

8.       Open rssvPolicy.config located in C:\Program Files\Microsoft SQL Server\MSSQL.x\Reporting Services\ReportServer\bin.

9.       After the last <CodeGroup .. add

<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="SSRSAssembly" Description="reportHelperLib. ">

                <IMembershipCondition

                class="UrlMembershipCondition"

                version="1"

                Url="C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\SSRSAssembly.dll"

/>

              </CodeGroup>

10.   Note you might have to change the Name and the URL.

Comments

# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Physical force or threats may make children do as wow goldthey're told in the short term but their compliance will last only as long as the threat is relevant. wow goldThen they will go back to doing what they wanted to do in the first place.
Left by hobg on 11/19/2008 7:11 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar In truth, the economy is slowing more markedly than these (highly suspect) official figures suggest. wow goldMany economists say that China has an institutionalised bias to over-reporting growth at the bottom of a cycle and under-reporting it at the top, to reduce the volatility of the numbers.
Left by mei on 11/19/2008 7:12 AM
# world of warcraft gold
Gravatar government researchers said Wednesday.
Left by bgg on 2/5/2009 10:10 PM
# wow gold
Gravatar “Cavalli” was chosen as the favorite menswear label in Florence in 2002,wow gold and Cavalli was picked
Left by zhuqian on 2/10/2009 6:37 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar I think this article was a great. easy to follow.
Left by dll on 3/14/2009 10:31 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar SSRS is just so nice man, I am loving ssrs in my new webapp.
Left by fixed gear on 8/4/2009 5:31 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar well stated
Left by vigrx plus on 8/11/2009 3:14 PM
# WOW
Gravatar Thanks for the great feature. Now was learning Java.After that I wanna learn about .Net so this could help me much better.
regards,
Left by best teeth whitener on 8/31/2009 3:59 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Great info, thanks a lot!
Left by Math Online on 10/20/2009 7:54 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar We've taken a slightly different approach to solve the same issue with Toucan Navigate. You can download it from our web site and see how it compares to your work. With Toucan, you can keep your ESRI shape files in their current location and overlay them on the VE tiles
Left by Nissan Steering Rack on 10/27/2009 3:15 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar I really thank your for the useful information, I really like it and think it’s a good topic. So would you interest at the news.
Left by Book Report on 11/23/2009 7:32 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar This is so good. You have a great blog.
Left by james lee on 12/4/2009 8:30 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar I really liked the info and it helped me a lot
Left by Make Money Online on 12/7/2009 11:14 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar I think this article was a great. easy to follow
Left by car games on 12/11/2009 2:25 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar thank you for great article.
Left by fashion games on 12/11/2009 12:14 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Great information. This is a bit Geeky - hehe... but really neat and helpful.
Left by home insurance california on 12/20/2009 8:06 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Great information. Very useful to me.
Left by GamerzPlanet on 12/22/2009 11:58 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar It's great to Using custom Assemblies with SQL Server Reporting Services.I feel good.
Left by RC Cars on 1/4/2010 11:21 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Using SQL server for reporting services is great. The presentation here is simple and yet informative.Succeed with ADHD
Left by Succeed with ADHD on 1/5/2010 6:53 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Information regarding SQL server is nicely presented here on your article.Great writing.I like it.
Left by Storage New Zealand on 1/5/2010 11:11 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Sounds hard on this one.I need further studies regarding SQL,Marketing Cheltenham
Left by SEO Cheltenham on 1/8/2010 3:32 AM
# Mr
Gravatar sql server are toughest subject in computers.i never touched it
Left by Electric scooter on 1/10/2010 1:51 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar thank you! That looks like a great resource
Left by William blog on 1/11/2010 11:32 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Why is SQL so hard to understand, I need further learning on this.
Left by Christchurch storage on 1/12/2010 3:24 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar YOur step by step procedure helps me a lot. Thanks.luxury brands marketing
Left by affluent consumers on 1/13/2010 7:20 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Thanks for this excellent tutorial.
Left by Seedboxes on 1/16/2010 6:25 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar An excellent tutorial.Keep posting.
Left by Design Business Website on 1/19/2010 6:52 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Tutorial is beautiful. Very well stated.
Left by Web Design Luton on 1/19/2010 7:10 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Thanks for the tips!
Left by C# on 1/22/2010 11:38 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Nice tutorial.Keep on posting.
Left by Property Management in MN on 2/2/2010 6:11 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Useful information. Thanks for sharing.Minneapolis Business Cards
Left by Minneapolis Business Cards on 2/8/2010 4:36 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar good informations and very useful.
Left by custom signs on 2/10/2010 3:15 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar A very nice posts.
The most comprehensive bestseller of Year by Year History of the Jewish people in one coffee-table volume. A serious research tool presented in simple style with graphic enhancements , charts, and color maps. The site includes a browsers version on the Web
Left by judaism history on 2/12/2010 4:35 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Thanks for the step by step directions. This post was very helpful.
Left by Ironman 2 news on 2/12/2010 8:38 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar You have a clear step by step instructions.
Left by massage listing on 2/12/2010 10:11 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Cost effective Web Design solutions. Logo Design for your brand. Business Cards for your business. Free Web Hosting, Free Domain Name included in all Web Design plans. Monthly lease payment plan. Profit Share payment plan. Pay online, get quote fast.
Left by Web Design Luton on 2/14/2010 2:59 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Find christian grants. Use our extensive funding directory of grant funding sources in finding grants or a christian grant.
Left by Christian Grants on 2/15/2010 12:43 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Thanks for putting together this great info! I am in the process of building my first project so this came in very useful for me.
Left by Apidexin reviews on 2/15/2010 8:22 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar how to set export options such that a particular report defaults to excel export. I’m talking about report specific settings…not just limiting the output for all exports.
Left by meilleurs jeux de casino on 2/18/2010 4:22 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Wonderful Article! I have bookmarked this page and I love to share this with my friends and circle of influence.
Left by Online Casino on 2/19/2010 4:43 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Awesome Post! I love reading it.
Left by Handbags on 2/19/2010 10:39 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar This is a Land for Sale in Alabama, list properties for Realtors and Brokers all over the United States
Left by Land for Sale in Alabama on 2/23/2010 4:19 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Thanks for the nice post.
Left by meet justin bieber on 2/23/2010 4:14 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar Good tips.
Left by braiding instructions on 2/23/2010 4:18 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar This will be pretty helpful to many professionals especially for those working IT people. Thanks for posting!
Left by Glass Pool Fencing on 2/24/2010 7:39 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar A pretty nice article.I bookmarked it , just in case I need this topic.
Left by minneapolis attorney on 2/28/2010 12:34 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar You can also use .NET interop assemblies in your reports to utilize the features of third party COM components. This scenario is very tricky and you probably have very little knowledge on how the methods are implemented internally in order to grant specific permission set for the assembly. So, any resource access from this assembly needs the Report Expression Host Assembly to be granted FullTrust permission in rssrvpolicy.config file, which could be risky in internet report applications. Any malicious code run using Expression Host on the Report Server with FullTrust,can get your Report Server down.
Left by Bridal Shops St Albans on 3/6/2010 11:19 AM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

 

Preview Your Comment.