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
# jamal
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 free online games on 8/4/2009 4:41 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 en rssvPolicy.config located in C:\Program Files\Microsoft SQL Server\MSSQL.x\Reporting Services\ReportServer\bin.

9. After the last <CodeGroup .. add
Left by christian louboutin sale on 11/16/2009 1:37 AM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar of the most popular questions is how d
Left by christian louboutin on 11/16/2009 8:49 PM
# re: Using custom Assemblies with SQL Server Reporting Services.
Gravatar through the wizard and 'upgrade' the solution/pro
Left by links of london on 11/19/2009 8:43 PM

Leave Your Comment

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

 

Preview Your Comment.