How to: Invoke a C# Assembly in SSRS

While SSRS has a lot of capabilities there are certain limitations that require the brute force of the CLR. This a walkthrough on how to create, reference and call a method in a C# assembly through SSRS in IDE mode or in Report Server mode. 

1.       First you need to create the C# assembly and make sure it’s decorated with the [assembly: AllowPartiallyTrustedCallers] attribute. You also need to make sure that the assembly is strong-named and that the methods are static for the implementation in this example. You can still use an instance class but the referencing would be under the SSRS Code context as opposed to a direct namespace reference.

In order for SSRS to use it the assembly needs to reside in specific places depending on the environment. For use in Visual Studio copy the compiled assembly to folder:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

For deployment the assembly needs to be located at:

C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin

2.       Now you can proceed to add the reference to the assembly in the RDL as follows:


3.       Now you can use any of the static classes/methods within the report as in setting the Visibility property to the actual C# static method that would do the parse on the parameter list as follows:



Skip to main content